coffeescript multiline strings compile into multiline strings

Try using the heredoc syntax:

myString = """
to life
the universe
and everything

This converts to this javascript:

var myString;

myString = "answer\nto life\nthe universe\nand everything\nis\n" + (40 + 2);

There’s not really any point to make it actually be on newlines in the compiled javascript visually, is there?

Leave a Comment