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 Answers
+ 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.