Skip to content

Instantly share code, notes, and snippets.

@kumavis
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumavis/3fed9853dd131daf0960 to your computer and use it in GitHub Desktop.
Save kumavis/3fed9853dd131daf0960 to your computer and use it in GitHub Desktop.
Block strings in javascript
(function (){/*
hey look at me
im a block string
a single string
across many lines
neat, huh?
*/}).toString().slice(15,-4)
@kumavis
Copy link
Author

kumavis commented Apr 29, 2014

blockString(function (){/*
hey look at me
im a block string
a single string
across many lines
neat, huh?
*/})

function blockString (blockFn) {
  return blockFn.toString().slice(15,-4))
}

@kumavis
Copy link
Author

kumavis commented Apr 29, 2014

note: would not survive minification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment