For the following script, how can I write a function that returns all of the script\'s functions as an array? I\'d like to return an array of the functions defined in the sc
Here is a function that will return all functions defined in the document, what it does is it iterates through all objects/elements/functions and displays only those whose type is "function".
function getAllFunctions(){
var allfunctions=[];
for ( var i in window) {
if((typeof window[i]).toString()=="function"){
allfunctions.push(window[i].name);
}
}
}
Here is a jsFiddle working demo