News for hackers. Stuff that matters.
Re:Multiline strings in JavaScript by gravity13 on Saturday July 12, 2014 @07:16AM (#8024266)
You can also

  var str = ' \
      <!doctype html> \
      <html> \
        <body> \
          <h1>❤ unicorns</h1> \
        </body> \
      </html> \
  ' 
I find it's better than string concat because the trailing \ is just one annoying thing rather than three.
Re:Multiline strings in JavaScript by jaredmcateer on Saturday July 12, 2014 @11:41AM (#8024820)
6 months later:

    var str = ' \
        <!doctype html> \
        <html> \
          <body> \ 
            <h1>❤ unicorns</h1> \
          </body> \
        </html> \
    ' 
Help I'm maintaining your code and I get a syntax error
Re:Multiline strings in JavaScript by jasonkostempski on Saturday July 12, 2014 @01:29PM (#8025160)
HA! I (don't) see what you did there :)
Re:Multiline strings in JavaScript by msujaws on Saturday July 12, 2014 @01:37PM (#8025183)
There is a space following one of the slashes.
Re:Multiline strings in JavaScript by tekacs on Saturday July 12, 2014 @07:46AM (#8024317)
... also this is (presumably) 'joined' at parse time, rather than runtime (and so only once per execution, guaranteed).