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/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Windows
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
toString
9212286.0 Ops/sec
string literal
46008532.0 Ops/sec
add empty string
45382664.0 Ops/sec
String
7191664.5 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));