> For the complete documentation index, see [llms.txt](https://hemantajax-2.gitbook.io/es6-in-depth/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hemantajax-2.gitbook.io/es6-in-depth/template-string/tagged-template-literal.md).

# Tagged Template Literal

```javascript
const name = "Hemant";
const age = 30;


function highlight(strings, ...values){
  let str = '';

  strings.forEach((s, i)=> {
    str += `${s} <span class="hl">${values[i] || ''}</span>`;
  });

  return str;
}

var str = highlight`my name is ${name} my age is ${age}`;
console.log(str)
```
