Hmm, now I’m second guessing myself At first I thought that A was correct. But primitives are immutable, their value cannot be changed. You can definitely reassign a variable with a new primitive, but I believe the original primitive value doesn’t change. So I’m tempted to think that A is not the answer.
As for whether B or C is correct, I guess I’m not sure what the red arrows are supposed to represent? As you noted, underneath the hood, a variable really stores a pointer to a location in memory. Are the red arrows representing actual memory pointers? If so, then I guess I would go with C. Or are they representing JS “references” such as when a JS variable stores an object (which is really a reference/pointer to another memory address)? If so then I would go with B.
In JS, when I think of a primitive value being stored on the stack, I don’t think of it as a variable storing a pointer to a memory address that holds the actual value. I cut out the middle man and just think of it as the variable stores the actual value itself. Since we can’t get the actual memory address of a variable in JS, I don’t see any reason to have to think of it in terms of memory pointers. If a variable stores an object then I think of it as the variable stores a “reference” to the object, which I know is technically a pointer to a memory location, but again, we don’t deal with pointers in JS so I’m fine thinking of it as a “reference”. My point here is that for primitives I think of them as what is represented in B.