Pot.js で利用可能。 PotLite.js では利用できません。
引数 o が空かどうかチェックします。
引数 o が空、もしくは空と判断できる値かどうか調べます。
Pot.globalize() が適応されている場合、Pot.isEmpty() が isEmpty() で実行できます。
引数 o が空なら true が返り、そうでない場合 false が返ります。
Pot.debug(Pot.isEmpty(null)); // true
Pot.debug(Pot.isEmpty(true)); // false
Pot.debug(Pot.isEmpty(false)); // true
Pot.debug(Pot.isEmpty(0)); // true
Pot.debug(Pot.isEmpty(-524560620)); // false
Pot.debug(Pot.isEmpty(0.1205562)); // false
Pot.debug(Pot.isEmpty('')); // true
Pot.debug(Pot.isEmpty('abc')); // false
Pot.debug(Pot.isEmpty(new String())); // true
Pot.debug(Pot.isEmpty([])); // true
Pot.debug(Pot.isEmpty([1, 2, 3])); // false
Pot.debug(Pot.isEmpty([[]])); // false
Pot.debug(Pot.isEmpty(new Array())); // true
Pot.debug(Pot.isEmpty(new Array('a', 'b'))); // false
Pot.debug(Pot.isEmpty({a:1, b:2, c:3})); // false
Pot.debug(Pot.isEmpty({})); // true
Pot.debug(Pot.isEmpty(new Object())); // true
Pot.debug(Pot.isEmpty((void 0))); // true
Pot.debug(Pot.isEmpty((function() {}))); // true
var f = function(a, b) {
return a + b;
};
Pot.debug(Pot.isEmpty(f)); // false