InterviewHubPRO
Section Overview
Q143

Question 143 of 521

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

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

How do you define multiline strings

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.