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:
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.
Note: Prototype is a global object constructor which is available for all JavaScript objects.
Property | |||||
---|---|---|---|---|---|
prototype | Yes | Yes | Yes | Yes | Yes |