---restore content starts---
Local variables: Use the keyword var to name the variable and only use it in the function that defines it!
Global variables: can be used anywhere! Defined outside the function!
closures: Child functions can use local variables of the parent function!
function A () { var b =2; function C () { alert (b); // 2 }}
Break: The entire loop jumps out of the interrupt!!!
Continue: Cycle Skip this time!
Aguments: variable parameter, indeterminate parameter, can be used as an array, the stored value is the parameter passed to the current function!
The following two functions are equivalent, the first function with a similar function of the method, abbreviated the second!
function sum (obj,name,value) { =value;}
{
ARGUMENTS[0].STYLE[ARGUMENTS[1]=ARUMENTS[2];
}
Array: Splice (start, length) can be used to insert, delete, add array elements
var aar = [1,2,3,4,5,6]arr.splice (2,3); // Delete: Splice (starting point, the length of the element to delete) Arr.splice (2,0, ' A ', ' B ', ' C '); // Insert: Splice (start, length, element to insert) Arr.splice (2,2, ' A ', ' B '); //Add: Splice (start, delete element length, element to add)
JavaScript Learning Notes