JavaScript
Multiline strings

by Benny Neugebauer

var text = 'Almost all of the really long sentences are under \
1,000 words. The six longest sentences (1,000+ \
words) are mostly a curiosity, just to see what is \
possible.';

var text = 'Almost all of the really long sentences are under ' +
'1,000 words. The six longest sentences (1,000+ ' +
'words) are mostly a curiosity, just to see what is ' +
'possible.';

That's a tough one.. both suck :)

Lipis

Didn't even know you could this with the \ at the return. Interesting…

Niels NTG

oh wow, red corner is actually a bad practice, some browsers will insert newlines at the continuance, use \multiline

es2015`'

Aleksandr Strutynskyy

ouch, use es2015 back ticks

Aleksandr Strutynskyy

`'Almost all of the really long sentences are under

1,000 words. The six longest sentences (1,000+

words) are mostly a curiosity, just to see what is

possible.'`

ES6 anyone

Khaled Garbaya

I would use template strings (es6), much easier to read.

Maurits Lourens

Red corner: You'd need to escape indents, too…

oldmud0

Sign in to comment!