Does loadsh have a way to convert an array to an object?

does loadsh have a way to convert an array to an object

Nov.22,2021

it is impossible to use arrays or objects directly to
if the requirements are different. Are you referring to
_ .groupBy (['one',' two', 'three'],' length');
/ = > {'3percent: [' one', 'two'],' 5arrays: ['three']}


?

if you mean ordinary objects, there is:

const arr = [1, 2, 3];
const obj = _.toPlainObject(arr);
console.log(obj); // => {0: 1, 1: 2, 2: 3}
Menu