1、isArray
_.isArray(value)
檢查 value
是否是 Array
類對象。
2、isElement
_.isElement(value)
檢查 value
是否是可能是 DOM 元素
3、isEqual
執行深比較來決定兩者的值是否相等
var object = { 'user': 'fred' }; var other = { 'user': 'fred' }; _.isEqual(object, other); // => true
object === other; // => false
4、isInteger
檢查 value
是否是整數
5、isMatch
_.isMatch(object, source)
執行一個深比較來確定object
是否包含有 source
的屬性值。
var object = { 'user': 'fred', 'age': 40 }; _.isMatch(object, { 'age': 40 }); // => true
_.isMatch(object, { 'age': 36 }); // => false
6、isNil
_.isNil(value)
檢查 value
是否是 null
或者 undefined
。
7、isPlainObject
檢查 value
是否是普通對象。 也就是說該對象由 Object
構造函數創建或者 [[Prototype]]
為空。
function Foo() { this.a = 1; } _.isPlainObject(new Foo); // => false
_.isPlainObject([1, 2, 3]); // => false
_.isPlainObject({ 'x': 0, 'y': 0 }); // => true
_.isPlainObject(Object.create(null)); // => true
8、isUndefined
9、isNull