JavaScript Program to Create Multiline Strings

bookmark

// program to create a multiline strings

// using the + operator
const message = 'This is a long message\n' + 
    'that spans across multiple lines\n' + 
    'in the code.'

console.log(message);

 

Output

This is a long message
that spans across multiple lines
in the code.