I am trying to iterate over all the globals defined in a website, but in doing so I am also getting the native browser functions.
var numf=0; var nump=0; var numo=0;
for(var p in this) {
if(typeof(this[p]) === "function"){
numf+=1;
console.log(p+"()");
} else if(typeof p != 'undefined'){
nump+=1;
console.log(p);
} else {
numo+=1;
console.log(p);
}
}
Is there a way to determine if a function is native to the browser or created in a script?
See Question&Answers more detail:os