Initial commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
const toObject = function toObject (array, property) {
|
||||
return array.reduce((finalObject, currentElement) => {
|
||||
finalObject[currentElement[property]] = currentElement;
|
||||
return finalObject;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export default toObject;
|
||||
Reference in New Issue
Block a user