Best Pratices for Object.assign: http://www.cnblogs.com/Answer1215/p/5096746.html Object.assign() can extend the object by adding new props: let obj = { first_name: 'Zhentian', age: 27 } Object.assign(obj, {last_name: 'Wan'}); console.log(obj); log o…
Learn how to use Object.assign() and the spread operator proposed for ES7 to avoid mutating objects. /* * Open the console to see * that the tests have passed. */ const toggleTodo = (todo) => { return { ...todo, completed: !todo.completed }; }; const…