String generation (v2)

Revision 2 of this benchmark created on


Setup

let first = 'First'
let second = undefined
let third = 'third'

Test runner

Ready to run.

Testing in
TestOps/sec
String interpolation
const result = `${first ?? ''} ${second ?? ''} ${third ?? ''}`
ready
Array join
const result = [first, second, third].join(' ')
ready
String concat
const result = (first ?? '') + ' ' + (second ?? '') + ' ' + (third ?? '')
ready
String.concat
''.concat((first ?? ''), ' ', (second ?? ''), ' ', (third ?? ''))
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.