I\'ve been trying to understand how this
value is set in javascript, and found ECMAScript Language Specification pretty much helpful. I was reading section 8.7
Yes, the base value is the context in which the referenced name lives.
For an object property, this would be the object (see §8.12 Object internal methods for setter/getter operations). For a variable, this would be the variable environment (§10.2.1 Environment records). For an unresolvable reference (the things that throw reference errors except when supplied to typeof), this would be undefined
.
it does not say how it is set
Reference
values are only constructed by very few operations:
.…
and […]
operators