Advertisement
kstoyanov

03. Object Factory

Oct 11th, 2020 (edited)
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function objectFactory(str) {
  2.   const input = JSON.parse(str);
  3.   const newObject = Object.assign({}, ...input.map(item => ({ ...item })));
  4.   return newObject;
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement