How to test same object instance in Javascript? -
How to test same object instance in Javascript? -
say have next objects in javascript:
var = { xxx: 33 }; var b = { xxx: 33 }; var c; c = a;
what javascript test tell me whether dealing same object instance? in other words, should homecoming false , b, b , c, true , c.
you need this
if(c == a) { // same instance }
a == b
, b == c
homecoming false
javascript instance
Comments
Post a Comment