Skip to content

Values and bindings

What a name holds

A binding holds a value, or it points at one. The difference is the whole track. · 8 minutes

A binding is a name with a slot behind it. Putting a number in that slot puts the number there. Putting an object in it does not: the object lives somewhere else, and the slot holds the way to reach it.

That distinction never comes up while you are writing code that works. It comes up the first time two names turn out to be reaching the same place.

`const a = [1, 2]; const b = a; b.push(3);` — what is `a.length` on the next line?