Difference between reference and instance in javascript
Sometimes I hear people say "a reference to a object" and some say "a instance of a object" What is the difference? A variable will hold a reference to an instance of an object. The actual object is an instance . The variable/variables used to access the object hold the references to it. Instance of an object (or, perhaps more accurately phrased when talking about languages that have the notion, of a class) is an object that has been created and exists in memory. For example, when writing var obj = new Foo(); Then a new instance of an object has been created (with new Foo ). Reference to an