Array: Arrays
Push: Adds a value to the end of the array, which can be one or more.
Alert (Arr.push (4, 5))
Join: Connect an array element with a delimiter in the middle.
var str = arr.join ("");
alert (str);
Reverse: The order of the points to the array is the operation itself.
Alert (Arr.reverse ());
splice: Adding or removing elements
var arr = new Array (6);
Arr[0] = "George";
ARR[1] = "John";
ARR[2] = "Thomas";
ARR[3] = "James";
ARR[4] = "Adrew";
ARR[5] = "Martin";
Arr.splice (0,1, "test");
Alert (arr);
concat: used to concatenate two or more strings.
Alert (Arr.concat (arr1, arr2));
String:
Length: A string that represents the lengths of the strings;
var str = "123456 ...";
alert (str.length);
split: used to separate strings, get an array of strings;
var str= "How is you doing today?";
document.write (Str.split ("") + "<br/>");
document.write (Str.split ("") + "<br/>");
document.write (Str.split ("", 1));
substr (): Used to extract strings
var str= "Hello world!";
document.write (STR.SUBSTR (6));
toLowerCase () is used to toggle the size of the string.
var str= "Hello world!";
document.write (Str.touppercase ());
document.write (Str.tolowercase ());
indexOf () detects whether a string exists within the detected string, and if so, returns the position where the string first appears, if no "1" is returned.
var str= "Hello World world!";
document.write (Str.indexof ("Hello") + "<br/>");
document.write (Str.indexof ("World") + "<br/>");
document.write (Str.indexof ("World"));
Interception of substring () strings
var str= "helloworld!";
document.write (Str.substring (3, 6));
Variable naming: Hump naming method Document.getelenment
Conversion of data types: var name (variable name) = parseint (text.value);//Convert value to integral type
Parsefloat ()//convert value to floating-point
Date: Day
Types of dates: date
var d =new Date (); Used to indicate that the current date and time are all time zone base standard times.
var today = new Date ();
var year = Today.getfullyear ();
var month = Today.getmonth ();
var day = Today.getdate ();
var hours = today.gethours ();
var mins = Today.getminutes ();
var s = today.getseconds ();
var str = year + "Years" + (month + 1) + "Month" + Day + "days" + hours;
alert (str);
JavaScript Array, Date, String