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.

Related Questions

Answer the question on the basis of the given information. Businesses are suffering because of lack of money available for development loans.To help businesses,the government plans to modify the income- tax structure in order to induce individual tax payers to put a larger portion of their incomes into retirement savings accounts, because as more money is deposited in such accounts, more money becomes available to borrowers. Which of the following, if true, raises the most serious doubt regarding the effectiveness of the government's plan to increase the amount of money available for development loans for businesses?