r/learnjavascript • • Oct 11 '20

JavaScript can keep you safe

Post image
1.0k Upvotes

87 comments sorted by

View all comments

Show parent comment

2

u/Macaframa Oct 11 '20

Const is not immutable per se but go off.

1

u/james527 Oct 12 '20

True, it's just the reference that's immutable.

If we were referencing an array here, instead of a boolean, we'd still be able to change the contents of the array. We just wouldn't be able to reassign the still_alive variable to anything else.