Learn the small problems in JS

Source: Internet
Author: User

1, if the loading of the 2 JS file has the name of the function, then the call when how to adjust the difference?
The second file was loaded with an invalid.

2. The Checked property of the CheckBox object of query is checked when selected, otherwise it is undefined;

The Checked property of the CheckBox object for JavaScript is True when selected, otherwise false.

3. This article is excerpted from the "JavaScript language Essence"--Electronic industry press

There are two ways to define a function: One is a function declaration and the other is a function expression.

(1) Functional declaration: Function Funname (ARG0,ARG1,ARG2) {function Body}

An important feature of the function declaration is the function declaration promotion, which means that the function declaration is read before the code is executed. This means that the function declaration can be placed behind the statement that called it.

(2) function expression: var funname = function (arg0,arg1,arg2) {functional body};

This form looks like a regular variable assignment statement because there is no identifier behind the function keyword, so it is an anonymous function. function expressions, like other expressions, must be assigned before they are used.

The form of the (1) function declaration is known as the function statement. A statement cannot begin with a function expression because the official syntax assumes that the statement that begins with the word function is a function statement. The workaround is to enclose the function call in parentheses.

1 (function  () {2             var  hidden_variable; 3             // This function may have some impact on the environment, but it does not introduce new global variables 4        } ());

Learn the small problems in JS

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.