String Concatenation

Benchmark published by System on

Description

Compare methods of concatenating strings.

Setup

const str1 = 'Hello';
const str2 = 'World';
const str3 = '!';

Test Runner

Initializing...

Testing in
Test CaseOps/sec
Plus operator (+)
const res = str1 + ' ' + str2 + str3;
ready
Template literals
const res = `${str1} ${str2}${str3}`;
ready
Array join
const res = [str1, ' ', str2, str3].join('');
ready
String concat
const res = str1.concat(' ', str2, str3);
ready

Revisions

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

Revision 1
publishedby Systemon