Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
manual chars vs charCode
(version: 0)
Comparing performance of:
manual chars vs charCode
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
manual chars
function wordToNums(word) { const alpha = "abcdefghijklmnopqrstuvwxyz"; return word.split("").map((letter) => alpha.indexOf(letter.toLowerCase()) + 1).join(" "); } console.log(wordToNums("Elzero")); // "5 12 26 5 18 15"
charCode
function wordToNums(word) { return word.split("").map((letter) => letter.toLowerCase().charCodeAt(0) - 96).join(" "); } console.log(wordToNums("Elzero")); // "5 12 26 5 18 15"
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
manual chars
charCode
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!
Comments
Confirm delete:
Do you really want to delete benchmark?