Reputation:
I'm getting exactly what I want when I do this console.dir(this)
in Chrome.
Is there a way to get that into an array some how?
So I've tried to do something like this to get started:
for(var o in console.dir(this)) {
console.log(o);
}
All I get is "undefined" and it prints the list into the console again.
I really just need a name list of all Native Javascript Objects and their respective methods and attributes without the hassle of manually creating and maintaining a monstrous list. Ideally the solution would be a dynamically created array of everything; either flat or multidimensional array so I can iterate through it.
Upvotes: 0
Views: 1951
Reputation: 112404
You're making it too hard: it's already in a dictionary, because everything in Javascript is already a dictionary.
Just open the javascript console and type this
, and you get an object that expands to
> this
DOMWindow
Infinity: Infinity
Array: function Array() { [native code] }
Attr: function Attr() { [native code] }
Audio: [object Function]
BeforeLoadEvent: function BeforeLoadEvent() { [native code] }
Blob: function Blob() { [native code] }
BlobBuilder: function BlobBuilder() { [native code] }
Boolean: function Boolean() { [native code] }
CDATASection: function CDATASection() { [native code] }
CSSCharsetRule: function CSSCharsetRule() { [native code] }
(truncated because you can see it yourself.) If you want a particular element of it, just address it: it's a DOMWindow
object, it has an element Array
, which has an element prototype
, which contains all the method functions.
Upvotes: 7