Comment

Comment by svat

In what way does it break down? Maybe if one is thinking of boxes, going by "a change to the value of a"? The book says:

> When a binding points at a value, that does not mean it is tied to that value forever. The = operator can be used at any time on existing bindings to disconnect them from their current value and have them point to a new one

In this case:

    let a = 22;
The binding a points to the value 22.

    let b = a;
The binding b points to the same value that a points to, namely 22.

    a = 23;
The binding a now points to a different value 23. The binding b is not affected.

I've linked it a few times in this thread, but see the equivalent article for Python, which explains it clearly: https://nedbatchelder.com/text/names1.html

(It cannot break down because it's how the language works.)

parent svat 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton