Test name | Executions per second |
---|---|
FOR | 1534.8 Ops/sec |
FOREACH | 19818.9 Ops/sec |
<!--your preparation HTML code goes here-->
/*your preparation JavaScript code goes here
To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/
let test = 0;
function globalMeasureThatScriptPrepareFunction() {
test = Math.random();
}
const ar = Array(100000);
for (let i= 0; i < ar.length; i++) {
globalMeasureThatScriptPrepareFunction();
}
ar.forEach(() => {
globalMeasureThatScriptPrepareFunction();
});