How to get function body text in JavaScript? [duplicate]

var entire = derp.toString(); 
var body = entire.slice(entire.indexOf("{") + 1, entire.lastIndexOf("}"));

console.log(body); // "a(); b(); c();"

Please use the search, this is duplicate of this question

Leave a Comment