Last active
September 15, 2019 18:11
-
-
Save paigen11/0657216f3d96cc2f9318b642ad4100b7 to your computer and use it in GitHub Desktop.
Example of the .raw argument in a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tag(strings) { | |
console.log(strings.raw[0]); | |
} | |
tag`I'd like this line 1 \n to ignore the newline and be in line with 1 | |
\n even though I should be on line 3 at this point`; | |
/* prints: I'd like this line 1 \n to ignore the newline and be in line with 1 | |
\n even though I should be on line 3 at this point */ | |
// including the two characters '\' and 'n' multiple times |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment