30秒学会 JavaScript 片段 – invertKeyValues
Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of e...
Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of e...
Given a flat array of objects linked to one another, it will nest them recursively. Useful for nesti...
Creates an array of key-value pair arrays from an object. Use Object.keys() and Array.prototype.map(...
Iterates over all own properties of an object, running a callback for each one. Use Object.keys(obj)...
Checks if the predicate (second argument) is truthy on all elements of a collection (first argument)...
Deep freezes an object. Use Object.keys() to get all the properties of the passed object, Array.prot...
Creates an object with keys generated by running the provided function for each key and the same val...
Iterates over all own properties of an object in reverse, running a callback for each one. Use Objec...
Maps the values of an array to an object using a function, where the key-value pairs consist of the ...
Replaces the names of multiple object keys with the values provided. Use Object.keys() in combinatio...