Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0
Chrome 134
Windows
Desktop
26 days ago
Test name Executions per second
Template Literal 401.9 Ops/sec
String Concatenation 602.9 Ops/sec
Array.join() 18.7 Ops/sec
HTML Preparation code:
AخA
 
1
<!--your preparation HTML code goes here-->
Script Preparation code:
 
const slug = '1234567890';
Tests:
  • Template Literal

     
    for (let i = 0; i < 1000000; i++) {
      const url = `/${slug}.html`;
    }
  • String Concatenation

     
    for (let i = 0; i < 1000000; i++) {
      const url = '/' + slug + '.html';
    }
  • Array.join()

     
    for (let i = 0; i < 1000000; i++) {
      const url = ['/', slug, '.html'].join('');
    }