The class is the blueprint, an instance is a specific building. A blueprint can be used to make multiple buildings.
“Reference” is related to calling functions. When you call a function and you pass in arguments, it’s important to know which arguments can be changed by the function. For example, if you call a `sort` function and give it an array, it doesn’t get a *copy* of the array. That would be inefficient. Instead, it gets a *reference* to the array, and it can actually do stuff to it. So that `sort` function can modify the array itself and not return anything.
In JavaScript, all objects are passed by reference. Otherwise, when you pass things like numbers or booleans, the function can’t change their values because it really gets a copy.
Latest Answers