August 1999
Intermediate to advanced
1488 pages
72h 53m
English
Date.prototype.property Date.prototype.method
The prototype property allows you to add new properties and methods to the Date object that can be used throughout your code.
In Listing 6.91, the prototype property is used to create a new method, called getDayString, which can be used by all Date objects. The getDayString() method uses the getDayString() function to return a string representation of the day of the week (for example, Sunday, Monday, Tuesday,…). This new functionality is used to display the name of the current day.
<html> <script> <!–– ... |
Read now
Unlock full access