Are DOM objects regular Javascript objects? If not, what are they?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, they’re “host objects”. They don’t necessarily play by all the same rules as native JavaScript objects.
They’re in some sense objects, but they’re added by the host environment and are not part of the ECMAScript specification.
For example, I don’t believe there’s anything that requires them to accept expando properties. Or in the case of functions, I don’t know that they’re required to have an accessible and extendable
prototypeproperty.Also functions may or may not have the typical methods of
Function.prototype, like.call()and.apply().The rules are simply much looser than those of objects defined by the ECMAScript specification, so you can’t necessarily rely on the same behavior in all cases.