Thank you both for your replies, and understand what you mean. I had not grasped the non-recursive aspect of
const - it feels a little strange, but, can use this now with more confidence. Appreciate the explanation.
The proposal here https://github.com/sebmarkbage/ecmascript-immutable-data-structures was linked on twitter. Needing new syntax now makes perfect sense.
Just as a final thought, I suppose another way of doing this could be something like
const immutable a = [1,2,3]; // or whatever
const b = [1,2,3];
a === b; // true
but, the syntax proposed in the link above is more succinct, and I suppose adding another keyword after const might have other pitfalls.
Regardless, both value types and the immutable data structure proposals are looking really interesting. Thumbs up for compare by value in JS coming soon