Skip to content

Instantly share code, notes, and snippets.

@samarpanda
Created February 7, 2015 19:04
Show Gist options
  • Save samarpanda/140688282c42c967f57d to your computer and use it in GitHub Desktop.
Save samarpanda/140688282c42c967f57d to your computer and use it in GitHub Desktop.
Detect if function is native to browser
var numf=0; var nump=0; var numo=0;
for(var p in this) {
if(typeof(this[p]) === "function"){
if(this[p].toString().indexOf('[native code]') === -1){
numf+=1;
console.log(p+"()");
}
} else if(typeof p != 'undefined'){
nump+=1;
console.log(p);
} else {
numo+=1;
console.log(p);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment