var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return tar
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