Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner 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

This comment has been minimized.

Copy link
Owner 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
You can’t perform that action at this time.