Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
66
rated 0 times [  70] [ 4]  / answers: 1 / hits: 61862  / 12 Years ago, mon, december 3, 2012, 12:00:00

How can you check if two or more objects/vars have the same reference?


More From » equality

 Answers
13

You use == or === :



var thesame = obj1===obj2;


From the MDN :




If both operands are objects, then JavaScript compares internal
references which are equal when operands refer to the same object in
memory.



[#81643] Saturday, December 1, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scarlett

Total Points: 491
Total Questions: 94
Total Answers: 100

Location: New Caledonia
Member since Thu, Mar 23, 2023
1 Year ago
;