Explore this JavaScript snippet:
var st, ary, ary1, ary2;
ary = [["a","b","c"], ["d","e","f"]]; // 2D array
ary1 = ary[1];
st = "d,e,f"; ary2 = st.split(',');
st = typeof(ary1) + " " + ary1.length + " " + ary1 + '\n'; // All in one string
st += typeof(ary2) + " " + ary2.length + " " + ary2 + '\n';
st += (ary1[0]==ary2[0])+'\n';
st += (ary1==ary2);
console.log(st);
.as-console-wrapper { max-height: 100% !important; top: 0; }
Result:
object 3 d,e,f
object 3 d,e,f
true
false
Why Same yet different? Curious minds inquire!