Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 861
James Fair Avatar asked Jun 18 '11 11:06

James Fair


1 Answers

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.

like image 149
Oded Avatar answered Oct 15 '22 09:10

Oded