Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
number to string js
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/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
toString
18652294.0 Ops/sec
string literal
95947936.0 Ops/sec
add empty string
102983792.0 Ops/sec
String
15245204.0 Ops/sec
Script Preparation code:
var numbers = [1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789];
Tests:
toString
numbers.forEach(n => n.toString());
string literal
numbers.forEach(n => `${n}`);
add empty string
numbers.forEach(n => n + "");
String
numbers.forEach(n => String(n));