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