How are escape sequences like n treated in template literals?

  • Treated as a newline character
  • Ignored
  • Treated as a literal backslash followed by 'n'
  • Throws an error
In template literals, escape sequences like n are treated as newline characters. This allows for multi-line strings without the need for explicit line break characters.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *