toString() vs toFixed(4)Fastest: toFixed(4) (1.5x faster)
16,650,836 ops/sec
11,304,220 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| toString() | |
| toFixed(4) |
| Test name | Executions per second |
|---|---|
| ✓ toFixed(4) | 16,328,293 Ops/sec |
| toString() | 8,979,583 Ops/sec |