Skip to main content
InterviewHubPRO
Section Overview
Q143

Question 143 of 536

Part 3: DOM, Event Flow, Timers & Browser APIs (104 - 173)

27%
JavaScript & V8 Internals (536 Qs)•Part 3: DOM, Event Flow, Timers & Browser APIs (104 - 173)

How do you define multiline strings

junior LevelCode ExampleHTTP & REST APIs

You can define multiline string literals using the '\n' character followed by line terminator('').

javascript
  var str = "This is a \n very lengthy \n sentence!";
  console.log(str);

But if you have a space after the '\n' character, there will be indentation inconsistencies.