top of page

`Template Literals` - the back ticks ` `

Back ticks can be found on the top left of the keyboard normally under the escape key


Back ticks can be used for multiline strings in javascript

let text = `Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ullam consequuntur reiciendis quia recusandae exercitationem, beatae harum iste sint. Amet, pariatur. Minima, neque magni. Eveniet quidem accusamus vitae quis porro dicta!`


They are also useful when you need to add variables to html


Inside the back tick you can use the following syntax $ { variable}


html = `<div class="label">${row}</div>`;



Comments


bottom of page