Just remember that while you may be using const in a static context, it is still a mutable value.
const
Yes, good point (I actually almost included a warning in there, but too many warnings and it would no longer be a "mini" crash course 😂)
Here's a good example:
const myObject = { value: "abc" }; myObject.value = "123"; console.log(myObject); // {value: "123"}
So yes - if you really need immutability, then you have to use another library, like: github.com/immutable-js/immutable-js
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just remember that while you may be using
const
in a static context, it is still a mutable value.Yes, good point (I actually almost included a warning in there, but too many warnings and it would no longer be a "mini" crash course 😂)
Here's a good example:
So yes - if you really need immutability, then you have to use another library, like: github.com/immutable-js/immutable-js