For example,
Math.mymfunc = function (x) { return x+1; }
will be treated as a property and when I write
for(var p in
Object.getOwnPropertyNames(Math); is what you are after.
Object.getOwnPropertyNames(Math);
This logs all of the properties provided you are dealing with an EcmaScript 5 compliant browser.
var objs = Object.getOwnPropertyNames(Math); for(var i in objs ){ console.log(objs[i]); }