The prototype property can also be used to extend JavaScript classes. In the following code, ISLEAPYEAR function () is implemented. It determines if the return value of getFullYear () is a leap year. ISLEAPYEAR () becomes a method of the Date object and therefore has access to Date.getFullYear(). <script language="JavaScript" type="text/JavaScript"> function isLeapYear() { var […]
Continue reading...
Continue reading...