Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Creating Multi-line Strings in Older Versions of JavaScript</title> </head> <body> <script> // Multi-line string var str = 'The quick brown fox\n\t' + 'jumps over the lazy dog.'; document.write("<pre>" + str + "</pre>"); // Creating string using variables and expression var a = 10; var b = 20; var result = 'The sum of ' + a + ' and ' + b + ' is ' + (a+b) + '.'; document.write(result); // The sum of 10 and 20 is 30. </script> </body> </html>