LoginSignup
6
6

More than 5 years have passed since last update.

is.js と underscore.js の empty チェック関数の違い

Last updated at Posted at 2015-03-18
is.js underscore
""(空文字) true true
null false true
undefined false true
[](空配列) true true
0 false true
is.empty('')  // true
_.isEmpty('') // true

is.empty(null)  // false
_.isEmpty(null) // true

is.empty(undefined) // false
_.isEmpty(undefined) // true

is.empty([])  // true
_.isEmpty([]) // true

is.empty(0)  // false
_.isEmpty(0) // true
6
6
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
6
6