LoginSignup
1
1

More than 5 years have passed since last update.

underscoreコードリーディング(isNull)

Posted at

underscoreに詳しくないので、勉強半分でソースコードを読む。

利用するバージョン

underscore.js(v1.8.3)

isNullとは

underscorejs.orgのisNull

こんな説明。

_.isNull(object)

Returns true if the value of object is null.

_.isNull(null);
=> true
_.isNull(undefined);
=> false

objectがnullだった場合にtrueを返します。

underscore.isNull

コード的にはこのあたり。

  // Is a given value equal to null?
  _.isNull = function(obj) {
    return obj === null;
  };

objとnullとの比較の結果を返す。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1