const obj ={ selector: { to: { val:'val to select'} }, target: [1,2, { a:'test'}] };get(obj,'selector.to.val','target[0]','target[2].a');// ['val to select', 1, 'test']
-
invertKeyValues
Inverts the key-value pairs of an object, without mutating it.
Use Object.keys() and Array.reduce() to invert the key-value pairs of an object.
constinvertKeyValues= obj =>
+
invertKeyValues
Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. If a function is supplied, it is applied to each inverted key.
Use Object.keys() and Array.reduce() to invert the key-value pairs of an object and apply the function provided (if any). Omit the second argument, fn, to get the inverted keys without applying a function to them.
Creates a new object from the specified object, where all the keys are in lowercase.
Use Object.keys() and Array.reduce() to create a new object from the specified object. Convert each key in the original object to lowercase, using String.toLowerCase().