1, assignment value, reference pass value
2 various objects (built-in objects and custom objects)
3.string objects:
Property |
Method |
Stringobj.length Get length |
Stringobj.charat (Index) Returns a character that specifies the subscript |
  |
stringobj.indexof (substr) < Span style= "font-family: Arial" > find character string first present position |
|
Stringobj.lastindexof (SUBSTR) Find where the string last appears |
|
String.substr (Startindex[,length]) intercepts substrings from the original string |
|
Stringobject.substring (Startindex[,endindex]) intercepts substrings from the original string |
|
Stringobject.split (Sep) splits a string into an array |
|
Stringobject.localecompare (target) compares the order of two strings |
|
Stringobject.replace (the regular expression , the character to be replaced ) replaces one string with another character string |
4.Array Objects
Property |
Method |
arrayobject.length < Span style= "FONT-SIZE:12PX; Color: #888888 "> Get the length of the array |
arrayobject.shift () < Span style= "FONT-SIZE:12PX; Color: #888888 "> Delete the first element in the array and return it |
|
arrayobject.unshift ( element 1, element 2) add one or more array elements to the beginning of the array |
|
arrayobject.pop () Delete the last element of the array and return it to |
|
arrayobject.push () add one or more array elements to the end of the array and return the new length to |
|
arrayobject.join ([Sep]) merging an array into a string |
|
arrayobject.reverse () Flips the array |
|
Arrayobject.sort (SortBy)
Sorting an array element
|
|
|
5. Date Object
method name |
function |
Dateobject.getfullyear () |
get 4 |
Dateobject.getmonth () |
get month The return value is Span style= "Font-family:calibri" >0 (January) to 11 |
Dateobject.getdate () |
get one day in one months The return value is Span style= An integer between "Font-family:calibri" >1 ~ |
Dateobject.gethours () |
return 0~23 hour |
dateobject. getminutes () |
return 0~59 minute |
Dateobject.getseconds |
Returns the number of seconds 0~59 |
dateobject. &NBSP; getmilliseconds () |
return milliseconds 0~999 |
Dateobject.getday () |
return one day of the week return value: 0~6 |
Dateobject.gettime () |
return timestamp from 1970 year 1 month 1 # 0 0 sub 0 seconds start to present in milliseconds |
Find where the string last appears
JS Fourth Day Study summary