Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
String() vs .toString() vs ``.toString()
(version: 0)
Comparing performance of:
toString() vs String() vs ``.toString()
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
toString()
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(num.toLowerCase()); }
String()
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(String(num).toLowerCase()); }
``.toString()
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(`${num}`.toLowerCase()); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
toString()
String()
``.toString()
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:
String() vs toString
String() vs .toString() vs + string
json stringify vs String() vs int tostring
'a string`.toString() vs `${'a string'}`
json stringify vs string tostring
Comments
Confirm delete:
Do you really want to delete benchmark?