Proficient in Javascript Basics

Source: Internet
Author: User

Basic concepts of javascrpit:
1) Case sensitivity is the same as that of Java. variables, functions, operators, and other things in JS are case-sensitive. For example, variables mytag and mytag are two different variables.
2) weak type changes. Therefore, the weak type variable indicates that the variable in JS does not have a specific type, unlike C. Only "Var" is used for variable definition and can be initialized to any value, so that the type of data stored in the variable can be changed randomly, which is not recommended;
For example, VAR age = 25;
VaR myname = "zhangsan ";

3) The semicolons at the end of each line are optional.
example:
var A = 2
var B = 3;
Note: If there is no semicolon, by default, JS considers the end of the Code line as the end of the statement.
4) brackets are used for code blocks, A code block indicates a series of code executed in sequence. Are enclosed in curly braces of JS. "{}"
example:
If (myname = "AA ")
{< br> var age = 67;
alert (AGE);
}< br> 5) method of annotation and C, C #, same as Java
// single line comment
/*
multi-line comment
*/
for HTML pages, javaScript code is contained in the middle of the MARK. You can also use the src attribute in


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.