Test name | Executions per second |
---|---|
+= | 11610.1 Ops/sec |
array joining | 13603.0 Ops/sec |
template strings | 11610.1 Ops/sec |
var str, strarr
var chars = 'abcdefghijklmnoprstuwxyz'
str = ''
while (str.length < 100) str += chars[ Math.floor( Math.random() * chars.length ) ]
strarr = []
while (strarr.length < 100) strarr.push(chars[ Math.floor( Math.random() * chars.length ) ])
str = strarr.join('')
str = ''
while (str.length < 100) str = `${str}${chars[ Math.floor( Math.random() * chars.length ) ]}`