Last updated 2 years ago
Was this helpful?
JS ⟩ value ⟩ primitive ⟩ String ⟩ raw string
// ⭐️ tag function (template function) function raw(strings) { // ⭐️ first argument (`strings`) has a special `raw` property return strings.raw; } // ⭐️ tagged templates raw`line 1 \n line 2`, // [ 'line 1 \\n line 2' ] (`\n` not escaped) raw`5 = \n ${2
String.raw() - tag function of template literals.
ignores escape sequences.
template literal
tag function