How can we make methods available on all objects?
How can we make methods available on all objects? Correct Answer
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 non enumerable, and if you add properties to Object.prototype, those properties will be reported by all for/in loops.
মোঃ আরিফুল ইসলাম
Feb 20, 2025