Valid template string literal syntax:
let s = ‘hello’;
console.log(`${`${`${`${`${`${`${`${`${`${`${`${s}`}`}`}`}`}`}`}`}`}`}`}`);
>hello
Valid template string literal syntax:
let s = ‘hello’;
console.log(`${`${`${`${`${`${`${`${`${`${`${`${s}`}`}`}`}`}`}`}`}`}`}`}`);
>hello
may I ask why tho?
LikeLike
These template literals are unusual because they can be interpolated with expressions. In other works instead of “hello” + name + “!” You can do `hello ${name}!`. This means you can insert any expression inside a template literal including other template literals. ie. It’s a recursive structure.
LikeLike
Yeah that is unusual historically. It’s usually a programmer pain point to have to mix different quote delimiters.
LikeLike