I am trying to understand what a Javascript immutable variable means. If I can do:
var x = astring;
x = str;
console.log(x); //logs str` , then why it is immutable?
The only answer I can think (from the little bit of C I know) is that var x is a pointer to a memory block with the value astring, and after the 2nd statement it points to another block with the value str. Is that the case?
And a bonus question: I was confused by the value types of Javascript. Are all variables objects under the hood? Even number and strings?