{"ScriptPreparationCode":"var arr = new Array(1000).fill(undefined)\r\nconst falsy = [false, \u0022\u0022, 0, null, undefined]\r\nconst truthy = [true, \u0022string\u0022, 10, {}, []]\r\n\r\nfor (let i = arr.length; i--;) {\r\n\tconst useFalsy = Math.random() \u003C 0.5\r\n\tconst source = useFalsy ? falsy : truthy\r\n\tconst index = Math.floor(Math.random() * source.length)\r\n\tarr[i] = source[index]\r\n}\r\n","TestCases":[{"Name":"Boolean","Code":"arr.filter(Boolean)","IsDeferred":false},{"Name":"x =\u003E !!x","Code":"arr.filter(x =\u003E !!x)","IsDeferred":false},{"Name":"x =\u003E x","Code":"arr.filter(x =\u003E x)","IsDeferred":false},{"Name":"delete \u002B .flat","Code":"for (let i = arr.length; i--;)\r\n if (!arr[i])\r\n delete arr[i]\r\narr.flat()\r\n","IsDeferred":false},{"Name":"own - preserve length","Code":"const {length} = arr\r\n, filtered = new Array(length)\r\nlet count = 0\r\nfor (let i = 0; i \u003C length; i\u002B\u002B) {\r\n const val = arr[i]\r\n if (val)\r\n filtered[count\u002B\u002B] = val\r\n}\r\n\r\nfiltered.length = count","IsDeferred":false},{"Name":"own","Code":"const {length} = arr\r\n, filtered = []\r\nlet count = 0\r\nfor (let i = 0; i \u003C length; i\u002B\u002B) {\r\n const val = arr[i]\r\n if (val)\r\n filtered[count\u002B\u002B] = val\r\n}\r\n","IsDeferred":false}]}