Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
string.charCodeAt(index) vs string[index].charCodeAt() vs +string[index]
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
charCodeAt(300)
8480823.0 Ops/sec
[0].charCodeAt()
8356395.0 Ops/sec
[300].charCodeAt()
8086396.0 Ops/sec
+[0]
8344734.0 Ops/sec
+[300]
8421745.0 Ops/sec
Script Preparation code:
var str = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
Tests:
charCodeAt(300)
str.charCodeAt(300)
[0].charCodeAt()
str[0].charCodeAt()
[300].charCodeAt()
str[300].charCodeAt()
+[0]
+(str[0])
+[300]
+(str[300])