Test name | Executions per second |
---|---|
String() | 5139344.0 Ops/sec |
.toString() | 1516883.1 Ops/sec |
let num = 500;
let nums = [];
for(let i = 0; i < 100; ++i) {
nums.push(num+'');
}
let num = 500;
let nums = [];
for(let i = 0; i < 100; ++i) {
nums.push(num.toString());
}