Template Literals
suggest changeTemplate literals are a type of string literal that allows values to be interpolated, and optionally the interpolation and construction behaviour to be controlled using a “tag” function.
Syntax
- message =
Welcome, ${user.name}!
- pattern = new RegExp(String.raw
Welcome, (\\w+)!
); - query = SQL
INSERT INTO User (name) VALUES (${name})
Template Literals were first specified by ECMAScript 6 §12.2.9.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents