All things in JavaScript are objects, such as strings, numbers, arrays, functions, and so on, each with properties and methods .
Object properties: reflect the object of certain specific properties, such as: the length of the string, the image of the long width, etc.;
object: an action that can be performed on an object. For example, the form "submit" (submit), the time of "get" (getYear), etc.;
JavaScript provides a number of built-in objects, such as String, Date, array, and so on, defined before using the object, using the array object as follows:
var objectName =new Array ();//Use the New keyword to define an object
or var objectName =[];
Syntax for accessing object properties:
Object name. property name;
Methods for accessing objects:
The name of the object. Method Name ();
Date Day Object
Date objects can store any date and can be accurate to milliseconds (1/1000 seconds).
Define a Time object:
var udate=new Date ();
Note : Use the first letter of the keyword New,date () to capitalize.
If you want to customize the initial values, you can use the following methods:
var d = new Date (2012, 10, 1); October 1, 2012
var d = new Date (' OCT 1, 2012 '); October 1, 2012
We'd better use the "method" described below to strictly define the time.
access method Syntax:"< date objects >.< methods >"
Common methods for processing time and dates in a Date object:
See the API for details
String String Object
Use the toUpperCase () method of the string object to convert the string lowercase letters to uppercase:
Returns the character at the specified position
The CharAt () method returns the character at the specified position. The returned character is a string of length 1.
Syntax:stringobject.charat (Index)
JS6 (built-in object)