HuntExams Academy logo
JavaScriptBeginner#es6#strings

What are template literals?

Answer

Backtick strings supporting interpolation with ${}, multi-line text without escapes, and tagged templates for custom processing such as escaping or styling.

Example

const name = 'Anu';
const msg = `Hello ${name},
you have ${2 + 3} messages`;

Related Interview Questions

1
JavaScriptAdvanced#functions

What is currying?

Open
2
JavaScriptIntermediate#functions

What is a higher-order function?

Open
3
JavaScriptAdvanced#performance#functions

What is memoization?

Open