Maps collection to be the keys of a new object, with the values determined by iteratee.
mapAsKeys([1, 2, 3], (item) => item * item);
// result: { 1: 1, 2: 4, 3: 9 }
mapAsKeys({ a: "foo", b: "bar" }, (_item, key) => key.toUpperCase());
// result: { foo: "A", bar: "B" }
Maps collection to be the keys of a new object, with the values determined by iteratee.
mapAsKeys([1, 2, 3], (item) => item * item);
// result: { 1: 1, 2: 4, 3: 9 }
mapAsKeys({ a: "foo", b: "bar" }, (_item, key) => key.toUpperCase());
// result: { foo: "A", bar: "B" }
Maps collection to be the keys of a new object, with the values determined by iteratee.
mapAsKeys([1, 2, 3], (item) => item * item);
// result: { 1: 1, 2: 4, 3: 9 }
mapAsKeys({ a: "foo", b: "bar" }, (_item, key) => key.toUpperCase());
// result: { foo: "A", bar: "B" }
Maps
collectionto be the keys of a new object, with the values determined byiteratee.