quick question:
why does this return false? Just curious.
var myArray = [];
var myArray1 = new Array();
console.log(myArray === myArray1)
quick question:
why does this return false? Just curious.
var myArray = [];
var myArray1 = new Array();
console.log(myArray === myArray1)
Two distinct objects are never === to one another (nor are they ==, for that matter). Object equality means that the two objects are really just one object; that is, that both sides of the === operator are references to the exact same object.
So, this will give you true:
var a = [], b = a;
console.log(a === b);
Every time you do
A new instance of the Array constructor is assigned to the variable. So when you do a equality check they aint same. Just as same as when two instance of a class aint same.