Comparing Arrays in Javascript


Understand that arrays are compared by reference, not by value.

Source Code

let a = [1, 2, 3];
let b = [1, 2, 3];
console.log(a === b); // false, because they are different instances
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments