Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
string to first character
(version: 0)
Comparing performance of:
to array position vs char
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var str = 'foo bar baz'; var noop = Function.prototype;
Tests:
to array position
let arr = Array.from(str); if(arr[0] == 'f') noop()
char
if(str[0] == 'f') noop();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
to array position
char
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
char index vs charAt()
char index vs charAt() for non-zero index
char index vs charAt() for the first character
get string but first case
Comments
Confirm delete:
Do you really want to delete benchmark?