10.14js notes (Entry level)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.