typeof & Nan & ==
来源:互联网 发布:汉诺塔递归python语言 编辑:程序博客网 时间:2024/06/05 03:03
readed 'JavaScript:the good part',and Add some note here :
1)Several Types in JS:numbers,strings,booleans,null,undefined,objects.
numbers&strings have methods,but the diff is objects are keyed collections . arrays,functions,regular expressions are objects.we can dig into it by typeof operator.
2)'Nan' and ' =='
JS has two sets of equality '==='and !===,and their evil twins == and !=.
IF the two operands are of the same type and have the same value,then === produces true and !== produces false;
the EVIL twins do right thing when the operands are of the same type,BUT IF THEY ARE DIFFERENT TYPE ,THEY ATTEMPT TO COERCE THE VALUE,unforunately,the rules are complicated,SO DO NOT USE IT IF POSSIBLE
By the way ,the operator NaN is the evil part too, so if you want to check the number,use this:
- typeof & Nan & ==
- js nan===nan
- loss=nan解决办法
- Javascript 中 null、NaN和undefined的区别 typeof 简介
- JS中NaN及+=执行顺序
- [Caffe]:关于diff = 0/nan
- tensorflow的cross_entropy(loss)=nan问题
- typeof(undefined) == undefined 成立吗?
- __block typeof(self) bself = self;
- typeof(self) bself = self的作用
- _weak typeof(self) weakSelf = self
- _weak typeof(self) weakSelf = self
- _weak typeof(self) weakSelf = self 相关
- _weak typeof(self) weakSelf = self;
- _weak typeof(self) weakSelf = self
- _weak typeof(self) weakSelf = self
- __weak typeof(self) _self = self;
- _weak typeof(self) weakSelf = self
- C Run Time--crt0.o 分析
- 世博会==人多
- js给表格增加一行总结
- multiple definition of...
- 张卫健被胃癌,自我炒作还是微波账户被盗?娱乐圈被死亡事件大揭秘
- typeof & Nan & ==
- C# AppDomain.CurrentDomain.BaseDirectory
- 很有用的面试知识---面试100问(不仅仅是面试)
- VC生成静态库release版比debug版库文件尺寸更大的原因
- 分享一个java正则验证类
- MFC获取时间
- warning C4995: 'wcscat': name was marked as #pragma deprecated
- 验证控件
- Linux基础系列-内存与I/O操作