JS function “Deep comparison”. Object comparison
问题 I wanted to implement JS function "Deep comparison" and encounter on one interesting feature. 1st case - var arrValuesObjA = [{ is: "an" }, 2]; var arrValuesObjB = [{ is: "an" }, 2]; console.log(Array.isArray(arrValuesObjA), arrValuesObjA); //true Array [ {…}, 2 ] // 0: Object { is: "an" } 1: 2 length: 2 console.log(Array.isArray(arrValuesObjB), arrValuesObjB); // true Array [ {…}, 2 ] // 0: Object { is: "an" } 1: 2 length: 2 for (let i = 0; i < arrValuesObjA.length; i++) { console.log