ExamVeda
Login
Home
This question belongs to Javascript Classes And Modules
Classes and Modules
?

How can we make methods available on all objects?

Answer & Solution
Correct Answer: Option D
It is possible to add methods to Object.prototype, making them available on all objects. This is not recommended, however, because prior to ECMAScript5, there is no way to make these add-on methods nonenumerable, and if you add properties to Object.prototype, those properties will be reported by all for/in loops.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.