Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
Object.assign is a great way to create shallow copies of an object. You can also combine this technique with Object.freeze if you want to force immutability.
varm=Object.freeze([2,5])m.push(6)// > ERROR: Can't add property 2, object is not extensible.
Object.assign is a great way to create shallow copies of an object. You can also combine this technique with Object.freeze if you want to force immutability.
Ok. Great