Underscore.JS 对象比较
Underscore.JS有很多易于使用的方法来帮助比较对象。本章将详细讨论这些方法。
Underscore.JS提供了各种处理对象比较的方法,如下所示:
序号 | 方法和语法 |
---|---|
1 | matcher _.matcher(attrs) |
2 | isEqual _.isEqual(object, other) |
3 | isMatch _.isMatch(object, properties) |
4 | isEmpty _.isEmpty(object) |
5 | isArray _.isArray(object) |
6 | isObject _.isObject(value) |
7 | isArguments _.isArguments(object) |
8 | isFunction _.isFunction(object) |
9 | isString _.isString(object) |
10 | isNumber _.isNumber(object) |
11 | isFinite _.isFinite(object) |
12 | isBoolean _.isBoolean(object) |
13 | isDate _.isDate(object) |
14 | isRegExp _.isRegExp(object) |
15 | isError _.isError(object) |
16 | isSymbol _.isSymbol(object) |
17 | isMap _.isMap(object) |
18 | isWeakMap _.isWeakMap(object) |
19 | isSet _.isSet(object) |
20 | isWeakSet _.isWeakSet(object) |
21 | isNaN _.isNaN(object) |
22 | isNull _.isNull(object) |
23 | isUndefined _.isUndefined(value) |