String Insertion vs Concatenation (v2)

Revision 2 of this benchmark created on


Setup

var text = 'I am a text.';

Test runner

Ready to run.

Testing in
TestOps/sec
Insertion
var result = [text.slice(0, 6), ' plain', text.slice(6)].join('');
ready
Concatenation
var result = text.slice(0, 6) + ' plain' + text.slice(6);
ready
Template literals
var result = `${text.slice(0, 6)} plain ${text.slice(6)}`;
ready

Revisions

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