Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
add empty string
90.4M/s
string literal
87.1M/s
toString
18.3M/s
String
14.9M/s
View exact numbers
Test name
Executions per second
✓
add empty string
90,375,448 Ops/sec
string literal
87,099,880 Ops/sec
toString
18,286,396 Ops/sec
String
14,875,169 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));