ES6 String Literals vs. String Concatenation v2 (v34)

Revision 34 of this benchmark created on


Setup

let obj = {
	name: "Hello",
	child: {
		name: "World",
	}
}

Test runner

Ready to run.

Testing in
TestOps/sec
String literals with object
var test = `This is ${obj.name} and its child ${obj.child.name}.`;
ready
String concatenation with object
var test = "This is " + obj.name + " and its child " + obj.child.name + ".";
ready
String concatenation with object
var test = "This is " + obj["name"] + " and its child " + obj["child"]["name"] + ".";
ready

Revisions

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