String() vs .toString() vs Concatenation vs Template stringFastest: Template string (6.6x faster)
4,955,924 ops/sec
4,679,190 ops/sec
1,429,108 ops/sec
755,721 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| String() | |
| .toString() | |
| Concatenation | |
| Template string |
| Test name | Executions per second |
|---|---|
| ✓ Template string | 3,309,128 Ops/sec |
| Concatenation | 3,251,533 Ops/sec |
| .toString() | 973,400 Ops/sec |
| String() | 498,177 Ops/sec |