0

Mutable and non-mutable data types in JavaScript ?

In the below article it is written that "objects & classes" are mutable. But as far as I know there is no such concept like "classes" in JavaScript. Also "objects" includes arrays, functions etc. then why are "objects" explicitly classified in mutable category. LINK: https://benmccormick.org/2016/06/04/what-are-mutable-and-immutable-data-structures-2

18th Sep 2019, 8:35 AM
harshit
harshit - avatar
1 Respuesta
0
Btw. ES6 introduced classes. Every object in JS is mutable. You can always add and change members. Even const objects are mutable.
18th Sep 2019, 8:44 AM
Aaron Eberhardt
Aaron Eberhardt - avatar