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