String.raw is the new '
What is the difference between these two Javascript snippets? The first snippet: console.log(\'\\\I want the raw string\');
The second snippet: console.log(String.raw\
\\I want the raw string`). The first will, somewhat surprisingly, process the string as if it had an escape character. The output will be the following:
\I want the raw stringHowever, String.raw, will do what I expect and output:
\\I want the raw string`