JS function attributes (default)
This
Arguments (class array)
Function FN () {This; arguments ;}
Return --> it can only be used in methods, that is, stop execution and exit the method;
Break; --> in a normal loop, it refers to jumping out of the current loop;
VaR A; alert (a); // A = undefined; alert (typeof B) // B = undefined; alert (c) // syntax error
If the variable is not defined, only typeof can be used for calculation. Other operations are caused by syntax errors;
Closure format
(Function (){
Alert (a) // The result is 7;
}) (7 );
(Function (){
VaR A =
Alert (a) // The result is 7;
}) (7 );
JS name explanation:
Children -- standard browser Element Node;
Childnodes --> all nodes;
Nodetype --- node type;
Nodevalue --- value of the node (valid only for text nodes (nodetype = 3 ))
Parentnode-Father's Day
Nodename --- node name (DIV, Li ,)
Firstchild --- the first node;
Lastchild --- the last node;
Tolowercase () -- convert to lowercase (generally used as a string );
Touppercase () -- converts to uppercase;
Firstelementchild -- New JS indicates the first element node;
VaR A = [];
A. Push () --- add to the array; stack later, 1, 2, 3
A. unshift () -- add to array; stack forward, 3, 2, 1
A. Pop () --- delete an array item and delete it from the back;
A. Shift --- delete an array and delete the first one