Recently, while reading the book "Eloguent Javascript" by Marijn Haverbeke, in chapter 2: Program Structure, section 2: Variables, I came across this statement:
They (variables) do not contain values; they grasp them
He then goes on to use the analogy of an octopus with many hands to demonstrate how variables grasp values.
This is the first time I'm seeing such a characterisation of variables. In other books and/or articles I've read, variables have usually been likened to boxes (in the computer's memory) containing values.
My question is: which is correct?
- Variables can be thought of as boxes containing values
- Variables don't contain values, they only grasp them
Am I the one getting it all wrong in my head? Do both explanations mean the same thing?