String objects. Both are fairly extensive, and both are useful. As you can guess from their names, the
Date object enables you to work with dates, and the
String object enables you to work with strings. I’ll discuss the
Date object in detail first.
Date objects store dates and provide many methods to extract the hours, minutes, and so on parts of dates. There are a number of different ways to create
Date objects, such as the following:
var date1 = new Date() var date1 = new Date(dateVal) var date1 = new ...