{"ScriptPreparationCode":"const size = 1024;\r\n\r\nvar buffer = new ArrayBuffer(size);\r\nvar u8View = new Uint8Array(buffer, 0, size);\r\n\r\nvar buffer2 = new ArrayBuffer(size);\r\nvar u8BoolView = new Uint8Array(buffer2, 0, size/8);\r\n\r\nvar booleanArray = [];\r\nfor (let i=0; i\u003Csize; i\u002B\u002B) {\r\n const someVal = Math.random()*1;\r\n //typed array stores (0 or 1)\r\n u8View[i] = someVal;\r\n //boolean array stores (false or true)\r\n booleanArray.push(someVal == 1);\r\n}\r\n\r\nfor (let i=0; i\u003Csize/8; i\u002B\u002B) {\r\n let some256Val = Math.random()*255;\r\n for (let j=0; j\u003C8; j\u002B\u002B) { \r\n }\r\n let FLAG_A = some256Val \u0026= 128;\r\n let FLAG_B = some256Val \u0026= 64;\r\n let FLAG_C = some256Val \u0026= 32;\r\n let FLAG_D = some256Val \u0026= 16;\r\n let FLAG_E = some256Val \u0026= 8;\r\n let FLAG_F = some256Val \u0026= 4;\r\n let FLAG_G = some256Val \u0026= 2;\r\n let FLAG_H = some256Val \u0026= 1;\r\n u8BoolView[i] = (FLAG_A | FLAG_B | FLAG_C | FLAG_D | FLAG_E | FLAG_F | FLAG_G | FLAG_H);\r\n}\r\n\r\n\r\n\r\n","TestCases":[{"Name":"boolean array ","Code":"const resultArray = booleanArray.map(s =\u003E {\r\n return (s == 1);\r\n});","IsDeferred":false},{"Name":"typed Array with uInt8","Code":"const resultArray = u8View.map(s =\u003E {\r\n return (s == 1);\r\n});","IsDeferred":false},{"Name":"boolean array - Strict","Code":"\u0027use strict\u0027;\r\nconst resultArray = booleanArray.map(s =\u003E {\r\n return (s == 1);\r\n});","IsDeferred":false},{"Name":"typed Array with uInt8 - Strict","Code":"\u0027use strict\u0027;\r\nconst resultArray = u8View.map(s =\u003E {\r\n return (s == 1);\r\n});","IsDeferred":false},{"Name":"weird boolean - Strict","Code":"\u0027use strict\u0027;\r\nconst resultArray = u8BoolView.map(s =\u003E {\r\n return ((s \u0026= 128) == 1);\r\n});","IsDeferred":false},{"Name":"uint8 .fill()","Code":"const resultArray = u8View.fill(1);","IsDeferred":false},{"Name":"weird boolean - .fill","Code":"const resultArray = u8BoolView.fill(255);","IsDeferred":false}]}