1.Date Date Object
(1) Syntax: var mydate=new Date ();
(2) Parameter description: MyDate becomes a Date object and has an initial value: current time (current computer system time).
(3) Access method syntax:< date objects >.< methods >;
(4) A common way to process time and dates in a Date object:
(5) Note:get/settime () Returns/sets the time, in milliseconds;
Time delayed 1 hours, that is: "X.settime (X.gettime () + 60 * 60 * 1000);"
2.String String Object
(1) Syntax: var stringobject= "I Love javascript!";
(2) Properties of the access string:stringobject.length; Gets the length of the string; note : Spaces also belong to one character
(3) How to access the string:
3_1:stringobject. toUpperCase ();//Convert the lowercase letter of the string to uppercase;
3_2:stringobject. toLowerCase ();//Convert the string capital letters to lowercase;
3_3:stringobject. charAt (index);//returns the character at the specified position; Note : 1. The subscript for the first character in the string is 0. The subscript for the last character is the string length minus one (string.length-1). 2. If the parameter index is not between 0 and String.length-1, the method returns an empty string.
3_4:stringobject. indexOf (substring, startpos);//Returns the position where the specified string appears; Note: the 1.indexOf () method is case-sensitive. 2. If the string value that you want to retrieve does not appear, the method returns-1.
3_5:stringobject. Split (separator,limit);//string segmentation; Note: If you use an empty string ("") as a separator, then each character in the Stringobject will be split between them.
3_6:stringobject. substring (Starpos,stoppos)//extract the string; Note: 1. The returned content is all characters from start (the character containing the start position) to stop-1, with a length of stop minus start. 2. If the parameter start is equal to stop, then the method returns an empty string (that is, a string of length 0). 3. If start is larger than stop, the method will exchange the two parameters before extracting the substring.
3. The remaining built-in objects are shown in link http://www.ibm.com/developerworks/cn/web/wa-objectsinjs-v1b/#list2
Built-in objects in JavaScript