Transform the keys and values of the input object using the mapper and return the mapped object. The returned object will be the same as the input if inPlace is truthy.
inPlace
Optional
import { map } from 'deleight/object/operations'const obj = map({ a: 1, b: 2, c: 3 }, (obj, key) => [`${key}1`, obj[key] * 3]); console.log(obj) // { a1: 3, b1: 6, c1: 9 } Copy
import { map } from 'deleight/object/operations'const obj = map({ a: 1, b: 2, c: 3 }, (obj, key) => [`${key}1`, obj[key] * 3]); console.log(obj) // { a1: 3, b1: 6, c1: 9 }
Transform the keys and values of the input object using the mapper and return the mapped object. The returned object will be the same as the input if
inPlace
is truthy.