You can return a js function's source!
Jan. 5th, 2019 08:48 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
OMGOMGOMG, I just discovered javascript's Function.prototype.toString() method.
Example:
I think I am hyperventilating.
I am going to get in so much trouble with this.
Once I stop cackling maniacally and dancing around the house in ecstacy.
Example:
function foo ( alert ( "Hello, World!" ); } alert ( foo.toString );... causes an alert pop-up to display with a text of function foo \n(\t alert ( "Hello, World!" );\n} (only with all those tabs and returns rendered correctly).
I think I am hyperventilating.
I am going to get in so much trouble with this.
Once I stop cackling maniacally and dancing around the house in ecstacy.