Quantcast
Channel: w3mentor » Object oriented Javascript
Viewing all articles
Browse latest Browse all 10

Extension of the Date class in Javascript

$
0
0
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...

Viewing all articles
Browse latest Browse all 10

Trending Articles