Skip to content

Instantly share code, notes, and snippets.

@flipflop
Created September 25, 2011 11:37
Show Gist options
  • Save flipflop/1240523 to your computer and use it in GitHub Desktop.
Save flipflop/1240523 to your computer and use it in GitHub Desktop.
JavaScript Multi-line String Concatenation
// old way
var myOldString = "some really long text repeated" +
some really long text repeated" +
some really long text repeated";
// Potentially better for Performance and Memory usage
var myString = "some really long text repeated\n\
some really long text repeated\n\
some really long text repeated";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment