Created
October 12, 2015 18:47
-
-
Save tjbrennan/5626fc73f2ddb2f2bdc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function multiline (func) { | |
var str = func.toString(); | |
var result = str.substring(str.indexOf('/*')+2, str.indexOf('*/')); | |
return result; | |
} | |
function foo () {/* | |
I am | |
a multiline | |
string | |
*/}; | |
console.log(multiline(foo)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment