Some basic knowledge points about JS

Source: Internet
Author: User

1. JS data type: Number,string,boolean,null,undefine,object.

2. In the loop of data: The function of break is to interrupt all loops to execute the statement below the Loop statement. Continue jumps out of the current loop and executes the next loop statement. The loop finishes executing. The statement following the execution of the loop statement.

3. JS has 3 kinds of bullets: alert (msg) can only be used as the information cue box performance, confirm (msg) information prompts to do the operation, confirm or Cancel, prompt (Msg,text) display can prompt the user to enter the dialog box.

4. js function can be with parameters, without parameters. The parameters of the parameter are limited to four;

Naming rules Small Hump method: First letter lowercase after other words capitalized as getmsg ();

The function name preceded by "_" will generally default to a class (object) Private method such as _getname ();

With the parameter function, when making a call, the number of arguments can not be equal to the number of arguments, the value of the parameter not passed in Undefine instead. General or parameter all incoming good. Avoid trouble.

There is a function object that stores the parameters of the current function call in a manner similar to an array of argument.

such as calling GetName (EXPR1,EXPR2, ... );

Original function getname () {

    var i = arguments[0];//equivalent to Expr1
。。。。
var in = argument "n" nth parameter exprn

}

This method can be used in cases where the number of parameters is not deterministic but is not recommended.

Some basic knowledge points about 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.