Heya, I tried before to write this but seems like I wasn't subscribed. Now seems like I subscribed so posting it again...
So here we go, I am posting this after an aftermath of a Github Issue. See => https://github.com/tc39/proposals/issues/150 I would like the JavaScript (ECMAScript) Spec to include built-in `deepCopy/deepClone` feature. Please note that based on the response at Github Issue and also considering that the top 3 npm packages for cloning have over 100k weekly downloads I am very positive on this and should be really considered. I think we have two approaches to consider for same 1. Object Oriented approach ```js // Object.prototype.deepCopy(), Array.prototype.deepCopy(), etc const harry = { name: 'Harry Manchanda', age: 25, social: [ { website: 'twitter', username: '@harmanmanchanda', }, { website: 'facebook', username: 'IamManchanda', }, ], }; const dev = harry.deepCopy(); dev.social[1].website = 'github'; ``` 2. Functional Programming approach ```js // Object.deepCopy(value) // Value expects array, objects and primitives const harry = { name: 'Harry Manchanda', age: 25, social: [ { website: 'twitter', username: '@harmanmanchanda', }, { website: 'facebook', username: 'IamManchanda', }, ], }; const dev = Object.deepCopy(harry); dev.social[1].website = 'github'; ``` Reason why I think so strongly that everyone in javascript community needs this is this => https://gist.github.com/search?l=JavaScript&q=deepcopy => https://gist.github.com/search?l=JavaScript&q=deepclone => https://github.com/search?l=JavaScript&q=deepcopy&type=Repositories => https://github.com/search?l=JavaScript&q=deepclone&type=Repositories *Thanks,* *Harman Singh Manchanda ( Harry )* *Open Source Team Member - Zurb Foundation <https://foundation.zurb.com/get-involved/yetinauts.html>*
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

