Example: Date object

This example includes a date object for the current date and time as well as a date object that is set to a specific date.

Notice the following:

  • The type of the date object is "object".
  • The month of December is encoded as 11.
  • An assignment statement can be used to change a property of an objectA slot for one of the values bundled in an object..

Note:

Hints:

  • undefined
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
var current = new Date();
var anotherDate = new Date(1834, 11, 22);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX