Returns true if object is NaN.
Note: this is not the same as the native isNaN function, which will also return true if the variable is undefined.

返回true如果对象是NaN, 原生函数isNaN.undefined类型也将返回true。这里将返回false

1 _.isNaN(NaN);
2 => true
3 isNaN(undefined);
4 => true
5 _.isNaN(undefined);
6 => false

源码:

  _.isNaN = function(obj) {
    return obj !== obj;
  };

 

 

posted on 2012-04-16 23:38  himanhimao  阅读(192)  评论(0编辑  收藏  举报