Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
'of' vs indexed charAt() to iterate characters in a string with prototype
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
char of
7327.6 Ops/sec
indexed charAt
8432.4 Ops/sec
Script Preparation code:
var testString = 'abcdefghijklmnopqrstuvwxyz';
Tests:
char of
for (char of testString) console.log(char);
indexed charAt
for (i = 0; i < testString.length; i++) console.log(String.prototype.charAt.call(testString,i));