
下劃線.JS - 對映物件
下劃線.JS 具有許多易於使用的方法,有助於對映物件。本章將詳細討論這些方法。
下劃線.JS 提供了各種方法來處理物件對映,如下所列 −
序號 | 方法和語法 |
---|---|
1 | keys
_.keys(object) |
2 | allKeys
_.allKeys(object) |
3 | values
_.values(object) |
4 | mapObject
_.mapObject(object, iteratee, [context]) |
5 | pairs
_.pairs(object) |
6 | invert
_.invert(object) |
7 | create
_.create(prototype, props) |
8 | functions
_.functions(object) |
9 | findKey
_.findKey(object, predicate, [context]) |
廣告