{"ScriptPreparationCode":"var objArr1 = [{\r\n a: 1,\r\n b: 2,\r\n c: 3,\r\n d: 4,\r\n e: 5,\r\n}]\r\nvar objArr2 = [{\r\n e: 5,\r\n b: 2,\r\n a: 1,\r\n d: 4,\r\n c: 3,\r\n}]\r\nfunction mapStringifySort($objArr1, $objArr2) {\r\n $objArr1 = $objArr1.map(obj=\u003EJSON.stringify(obj)).sort()\r\n $objArr2 = $objArr2.map(obj=\u003EJSON.stringify(obj)).sort()\r\n for (let i=0; i\u003C$objArr1.length; i\u002B\u002B){\r\n if($objArr1[i]!==$objArr2[i]) return false\r\n }\r\n return true\r\n}\r\nfunction multipleLoops($objArr1, $objArr2) {\r\n const has = Object.prototype.hasOwnProperty\r\n return $objArr1.every(($obj1)=\u003E{\r\n let $obj1Len = Object.keys($obj1).length\r\n return $objArr2.some(($obj2)=\u003E{\r\n for(let key in $obj1) {\r\n if($obj2[key]!==$obj1[key]) {\r\n return false\r\n }\r\n if(!has.call($obj2,key)) {\r\n return false\r\n }\r\n }\r\n return $obj1Len===Object.keys($obj2).length\r\n })\r\n })\r\n}","TestCases":[{"Name":"Map-JSON.stringify \u002B Sort","Code":"for(let i=0; i\u003C10000; i\u002B\u002B) {\r\n console.log(mapStringifySort(objArr1,objArr2))\r\n}","IsDeferred":false},{"Name":"Multiple Loops","Code":"for(let i=0; i\u003C10000; i\u002B\u002B) {\r\n console.log(multipleLoops(objArr1,objArr2))\r\n}","IsDeferred":false}]}