CodePen Home What is faster? Single quotes, double quotes or backticks?

Benchmark created on


Preparation HTML

<label>Iterations <br><input type="number" value="1000000"></label><br>
<button>Start performance test</button>

<output></output>

Setup

function logToOutput(message) {
    const outputElement = document.querySelector("output");
    outputElement.innerHTML += `<p>${message}</p>`;
}

Test runner

Ready to run.

Testing in
TestOps/sec
backticks
logToOutput(`This is a string with backticks`)
ready
double quotes
logToOutput("This is a string with backticks")
ready
single quotes
logToOutput('This is a string with backticks')
ready

Revisions

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