Adam Brodziak
Adam Brodziak

Jan 14, 2019

·
1 min read

…ode review, to avoid this pitfall. Notice that using const foo did not prevented from modifying it. I haven’t found an ESLint rule that would prevent modification of first parameter in Object.assing() call.

Use JS object spread operator instead of Object.assign() pattern in Node 8
74
3

Adam Brodziak

Found the ESLint plugin preventing mutation in Object.assign()call if anyone is interested:

https://github.com/jfmengels/eslint-plugin-fp/blob/master/docs/rules/no-mutating-assign.md

--

--

More from Adam Brodziak

Father. Husband. Solutions developer profesionally (software quite often). Arsenal supporter. Cyclist.

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Get unlimited access
Adam Brodziak

Adam Brodziak

155 Followers

Father. Husband. Solutions developer profesionally (software quite often). Arsenal supporter. Cyclist.

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech