JS Built-ins
StringString.rawbeginner

String.raw β€” backslash-n not a newline

πŸ“– Usage Example
String.raw`Hello
World`   // β†’ 'Hello\nWorld'
String.raw`C:\Users\me`    // β†’ 'C:\Users\me'

Use String.raw as a tagged template to get the raw string form where backslash escapes are not processed.

String.raw β€” Escape Sequences Not Interpreted

In a normal template literal, \n becomes a newline. With String.raw, it stays as the two characters \ and n.

Challenge: Implement rawNewline() that returns the two-character string \n (not an actual newline) using String.raw.

rawNewline() // β†’ '\n'  (2 chars: backslash + n)
πŸ’‘ Hints (2)
  • β€’ `String.raw\`\n\`` β†’ the 2-char string `\n`, not a newline.
  • β€’ The backslash character has char code 92.