What you need to be aware of in the use of JavaScript and some basic grammar _ basics

Source: Internet
Author: User
1, Javacsript implementation of hyperlinks: <a href= "JavaScript (' Hello ') > Dot </a>

2, the function call in JavaScript can be before the function declaration.
3. JavaScript does not require all paths to have return values, as in C #, and returns undefined when there is no return value
anonymous function:
Copy Code code as follows:

var f1=function (i1,i2) {return i1+i2};
Alert (F1 (10,12));
Alert (function (i1,i2) {return i1+i2} (10,12));

4, Javascript does not have the concept of namespaces, two JS files appear with the same name function is the last reference or the final declaration of the function as prevail.
When referencing external JS file: Cannot <script src= "..." type= "Text/javascript"/>, must be written: <script src= "..." type= "Text/javascript" ></ Script>

5, JavaScript is not a class of syntax, is used to simulate the closure of functions.

6. The array in JS is not only a normal array, but also can be used as dictionary and stack.

Copy Code code as follows:

var array=new array ();
array["Person"]= "Ren";
array["Kou"]= "Kou";
array["Hand"]= "Shou"
Related Article

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.