Standard built-ins
String.raw()
Builds text using raw template segments and converted substitutions. Useful when escape spellings should remain literal.
Formal Syntax & Structure
javascript syntaxjavascript
String.raw(template, ...substitutions)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| template | Object | Template object with raw segments. |
| substitutions | Any | Additional substitution values. |
Return Value
String
Combined raw text.
Working Example
Example Snippetjavascript
console.log(String.raw`a\nb`);