JS Built-ins
StringString.rawintermediate

String.raw β€” interpolation still works

πŸ“– 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 β€” Expressions Are Still Interpolated

String.raw does not prevent ${expression} interpolation β€” only backslash escapes are raw.

Challenge: Implement rawWithName(name) that returns Hello, <name>!\n (with a literal \n) using String.raw.

rawWithName('Alice') // β†’ 'Hello, Alice!\n'
πŸ’‘ Hints (1)
  • β€’ `${name}` still expands normally in `String.raw` β€” only escape sequences like `\n` are left raw.