Make a new array method that transforms array values into upper case:
Make an array, then call the myUcase method:
The values in the fruits array is now:
Try it yourself »
Definition and Usage
The prototype constructor allows you to add new properties and methods to the Array() object.
When constructing a property, ALL arrays will be given the property, and it's value, as default.
When constructing a method, ALL arrays will have this method available.
Note: Array.prototype does not refer to a single array, but to the Array() object itself.
The prototype property is supported in all major browsers.
Thank You For Helping Us!
Your message has been sent to W3Schools.