I was reading about template literals in the ES2015 spec which allows you to create (among other things) line breaks like so:
var brokenStr = `This is
string.`; //This is a broken string
var anotherBrokenStr = 'This is \
also a broken \
string.'; //This is also a broken string.
document.getElementById('logger').innerHTML = brokenStr;
This is also a broken string.
var anotherBrokenStr = 'This is \\n
also a broken \\n
Here's the output of my Node.js REPL showing the difference between the two:
> `hello ... world` 'hello\nworld' > 'hello\ ... world' 'helloworld'
In the first case we get a newline between
'world'. In the second case we don't.
Edit: Dear Lord, you're thoroughly confused.
HTML doesn't respect newlines. It doesn't matter how many newlines you put in between your lines. HTML will still print it as a single line.
Hope that makes things clear.