3 ms·
I’m curious for feedback about the very beginning of this post. How many people see the “let a” example as “the variable ‘a’ keeps changing shape/type” and how
by Waterluvian 4y ago
I’m curious for feedback about the very beginning of this post.
How many people see the “let a” example as “the variable ‘a’ keeps changing shape/type” and how many see it as, “three different things were created and the variable ‘a’ kept getting reassigned to point at the newest one.”
Or is this not really a distinction people see?
- skybrian 4y agoIt seems like the beginning of the post avoids the issue. "First a was this, now it's this" doesn't take a position on whether it's really the same object, just how it appears in the debugger.
- glenjamin 4y agoMy mental model of JavaScript is that the name/label “a” in that scope was re-used 3 times, but for a different value each time