I agree that changing the behaviour makes sense. But what if we wanted to maintain the behaviour, what name could we give to that behaviour. cannot reassign but can modify.
We could follow the path taken by Elm and their awesome error messages like:
I saw you used a constant here:
const fruits = [...];
^
|
here
It seems like you tried to update one of its member:
fruits[0] = ...
^
|
here
I think that you might wanna use Object.freeze to prevent causing side effects
const fruits = Object.freeze([...]);
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.
That's an interesting question. Thanks for asking!
In my opinion, I don't think that we should rename the keyword, but instead change the behavior of this keyword for objects and arrays especially.
That would make more sense to me. What do you think?
I agree that changing the behaviour makes sense. But what if we wanted to maintain the behaviour, what name could we give to that behaviour.
cannot reassign but can modify
.We could follow the path taken by Elm and their awesome error messages like: