to-object-map
v0.1.0
Published
Convert array of object to Object with proprty as key of the Object
Downloads
2
Readme
toObject
Utility function to convert a given arry to Object
Syntax
convertArrayToObject(Array, 'key')
const dataObj = {
1: {name: "1", value: "one"},
2: {name: "2", value: "two"},
3: {name: "3", value: "three"},
};
const key = "name";
const result = convertArrayToObject(data, key);
Installation
npm install to-object