0
Equality of Arrays: JavaScript Challenge
/* My challenger and I both answered this one wrong. My understanding is that == means equality, not assignment and not duplication. So why is the answer false, true? */ What is the output? var arr1= [1,2,3]; var arr2= [1,2,3]; var arr3= arr1; console.log(arr1==arr2); console.log(arr1==arr3);
2 ответов
+ 1
Tahiti🌍Castillo
Reference matters
The references of arr1 and arr2 are not same
But references of arr3 and arr1 are same because you have given reference of arr1 to arr3
0
A͢J thank you. JavaScript can be so confusing sometimes.