alonronin 2249 days ago. link -1 point ▲ ▼const only make sure you cannot REASSIGN the variable again. if you wish to have immutable objects use (https://github.com/mweststrate/immer) or immutable.js. linters do have rules for prohibiting side affects (https://eslint.org/docs/rules/no-param-reassign)
alonronin 2918 days ago. link 2 points ▲ ▼your code is nice and elegant, however lodash treats more use cases, and performance proved (not just saying 'fast' at the title) i'd use lodash in my project, but i like yours also.