{"ScriptPreparationCode":"// Array with alternating empty and non-empty arrays\r\nconst arraySize = 1000;\r\nvar testArray = new Array(arraySize)\r\n .fill(null)\r\n .map((_, i) =\u003E i % 2 === 0\r\n // Make the values alternate between 0-2\r\n ? new Array(i).fill(0).map((_, j) =\u003E j % 2) \r\n : []);\r\n\r\nfunction lengthPropertyDestructured({ length }) {\r\n // Doesn\u0027t return a boolean, but will cause an automatic cast\r\n return length;\r\n}\r\n\r\nfunction lengthGreaterThanZeroDestructured({ length }) {\r\n return length \u003E 0;\r\n}\r\n\r\nfunction doubleNegateLengthDestructured({ length }) {\r\n return !!length;\r\n}\r\n\r\nfunction lengthGreaterThanZeroDestructured({ length }) {\r\n return length \u003E 0;\r\n}\r\n\r\nfunction lengthPropertyNormal(row) {\r\n // Doesn\u0027t return a boolean, but will cause an automatic cast\r\n return row.length;\r\n}\r\n\r\nfunction doubleNegateLengthNormal(row) {\r\n return !!row.length;\r\n}\r\n\r\nfunction lengthGreaterThanZeroNormal(row) {\r\n return row.length \u003E 0;\r\n}\r\n\r\nfunction doubleNegate(value) {\r\n return !!value;\r\n}\r\n\r\nvar booleanConstructor = Boolean;\r\n\r\nfunction arrayLengthProperty(row) {\r\n return row.length !== 0;\r\n}\r\n\r\nfunction arraySomeMethod(row) {\r\n return row.some(() =\u003E true);\r\n}\r\n\r\nfunction objectKeys(row) {\r\n return Object.keys(row).length \u003E 0;\r\n}\r\n\r\nfunction forOfLoop(row) {\r\n for (let _ of row) return true;\r\n return false;\r\n}\r\n\r\nfunction isArrayWithLength(row) {\r\n return Array.isArray(row) \u0026\u0026 row.length \u003E 0;\r\n}\r\n\r\nfunction typeofArrayWithLength(row) {\r\n return typeof row === \u0027object\u0027 \u0026\u0026 row !== null \u0026\u0026 row.length \u003E 0;\r\n}\r\n\r\nfunction firstElementCheck(row) {\r\n return row[0] !== undefined;\r\n}","TestCases":[{"Name":"Double negation (!!row.length) with destructuring","Code":"testArray.filter(doubleNegateLengthDestructured);","IsDeferred":false},{"Name":"Double negation (!!row.length) without destructuring","Code":"testArray.filter(doubleNegateLengthNormal);","IsDeferred":false},{"Name":"Comparison (row.length \u003E 0) with destructuring","Code":"testArray.filter(lengthGreaterThanZeroDestructured);","IsDeferred":false},{"Name":"Comparison (row.length \u003E 0) without destructuring","Code":"testArray.filter(lengthGreaterThanZeroNormal);","IsDeferred":false},{"Name":"Double negation (!!row)","Code":"testArray.filter(doubleNegate);","IsDeferred":false},{"Name":"Boolean constructor","Code":"testArray.filter(booleanConstructor);","IsDeferred":false},{"Name":"Array.length property","Code":"testArray.filter(arrayLengthProperty);","IsDeferred":false},{"Name":"Array.some() method","Code":"testArray.filter(arraySomeMethod);","IsDeferred":false},{"Name":"Object.keys()","Code":"testArray.filter(objectKeys);","IsDeferred":false},{"Name":"for...of loop","Code":"testArray.filter(forOfLoop);","IsDeferred":false},{"Name":"Array.isArray() with length","Code":"testArray.filter(isArrayWithLength);","IsDeferred":false},{"Name":"typeof with length","Code":"testArray.filter(typeofArrayWithLength);","IsDeferred":false},{"Name":"First element check","Code":"testArray.filter(firstElementCheck);","IsDeferred":false},{"Name":"Length property cast with destructuring","Code":"testArray.filter(lengthPropertyDestructured);","IsDeferred":false},{"Name":"Length property cast without destructuring","Code":"testArray.filter(lengthPropertyNormal);","IsDeferred":false}]}