what does the model of a (global?) object look like?
Hey, what does the model of a (global? i'm not sure if that's the right word) object look like?
For example
document
in document.querySelector
. I understand that document
is the object, but is it a class that has a function called querySelector
in along with the others? e.g.
I'd appreciate any help, thanks in advance.1 Reply
In JS, everything is an object, and
document
is no exception. Like most built-in object, it has properties (document.body
) and methods (document.querySelector()
). If you head over to MDN's page on the document APIs you'll see all the properties and methods it contains.
Also, for future reference, this question is better suited to #discussions as it's not asking about specific code. So if you'd like to continue discussing it feel free to make a post over there!