1. Common Object Types
Time (date) object
Math Object
String Object
Regular expression (REGEXP) object
Arrays (Array) objects
2.Date Object ://var date= new Date ();
. GetYear ()//Acquisition Year 13
. getFullYear ()//Acquisition Year 2013
. GetMonth ()//Get month (requires + 1)
. GetDate ()//Acquisition Day
. GetHours ()//acquired
. getminutes ()//Get points
. getseconds ()//Get seconds
. GetDay ()//Get Week (obtained is 0~6, need to use array allocation)
3.Math Object ://Do not need new, direct use
Math.Abs (-200)//Get the absolute value of the number (200 absolute value is 200,-200 absolute value is also 200)
Math.ceil (12.35)//returns the smallest integer greater than or equal to the number (returns 13)
Math.floor (12.95)//returns the smallest integer less than or equal to the number (returns 12)
Math.Round (12.3/12.9)//rounded (return 12/13)
Math.random ()//random
4.String Object ://var str= "ABCdef"
. length//String lengths (this is a property)
. Split ()//split the string to form a string array
. Match ()//Match regular
. CharAt ()//returns the character at the specified index
. substr (1,4)//Returns a string of a specified range
. replace ()//Replace
. toUpperCase ()//turn into uppercase
. LASTINDEXOF ()//returns the location of the last occurrence of the specified character
5.RegExp Object ://var zz=/mode/mode modifier
Refer to the regular syntax for use with a string object
@zhnoah
Source: http://www.cnblogs.com/zhnoah/
This article is owned by me and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original
The right to pursue legal liability.
JavaScript learning Note--3. System objects