Array.prototype
JavaScript 1.1+, ECMAScript 1.0+, JScript 3.0+ Nav3+, NES3+, IE 4+ Syntax
Array.prototype.property Array.prototype.method
Description
The prototype property allows you to add new properties and methods (designated as property/method in Syntax section) to the Array object that can be used throughout your code.
Example
In Listing 6.52, the prototype property is used to provide a pop() method for working with arrays. Even though the pop() method is already available to Netscape browsers, the method is not supported by Internet Explorer. To make this method available to both browsers, a new pop() method is created. This method overrides the functionality of the Netscape Array.pop() method. The new pop() method is used at the ...
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.