扫码一下
查看教程更方便
underscore.js 有许多易于使用的方法,有助于处理对象比较。 本章将详细讨论它们。
underscore.js 提供了各种方法来处理对象比较,如下所示
序号 | 方法 | 语法 |
---|---|---|
1 | matcher | _.matcher(attrs) |
2 | isequal | _.isequal(object, other) |
3 | _.ismatch(object, properties) | |
4 | _.isempty(object) | |
5 | _.isarray(object) | |
6 | isobject | _.isobject(value) |
7 | isarguments | _.isarguments(object) |
8 | isfunction | _.isfunction(object) |
9 | isstring | _.isstring(object) |
10 | _.isnumber(object) | |
11 | isfinite | _.isfinite(object) |
12 | isboolean | _.isboolean(object) |
13 | isdate | _.isdate(object) |
14 | isregexp | _.isregexp(object) |
15 | iserror | _.iserror(object) |
16 | _.issymbol(object) | |
17 | ismap | _.ismap(object) |
18 | _.isweakmap(object) | |
19 | isset | _.isset(object) |
20 | isweakset | _.isweakset(object) |
21 | _.isnan(object) | |
22 | isnull | _.isnull(object) |
23 | _.isundefined(value) |