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
indexed charAt
8K/s
char of
7K/s
View exact numbers
Test name
Executions per second
✓
indexed charAt
8,432 Ops/sec
char of
7,328 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));