I want to know how to convert a function\'s body into a string?
function A(){ alert(1); } output = eval(A).toString() // this will come with function A()
If you're going to do something ugly, do it with regex:
A.toString().match(/function[^{]+\{([\s\S]*)\}$/)[1];