JavaScript Learning Tutorials

Source: Internet
Author: User

1,javascript is a lightweight programming language that is a programming code that can insert HTML pages.

2, start with <script> tag, end with </script> tag.

3, reference the script file with the extension. js in the external file <script src= "Myscript.js" ></script>

4, only Var can be used to declare variables, variables must start with a letter, variable names are case sensitive (Y and y are different variables), and many variables are declared in one statement. The statement starts with VAR and separates the variables with commas.

To re-declare the JavaScript variable, the value of the variable will not be lost, such as var carname= "Volvo"; var Carname; carname's value or Volvo,

A variable that is not declared with a value, whose value is actually undefined such as: the value of the Var carname;carname is actually undefined

You can empty a variable by setting the value of the variable to null.

When declaring a new variable, the keyword "new" can be used to declare its type, var car = new Object;

Assigns a value to a variable that has not been declared, and the variable is automatically declared as a global variable

function

a function is a block of code wrapped in curly braces, preceded by a keyword function:

function functionname () {Here is the code to execute};

1, the keyword function must be lowercase, and the function must be called with the same casing as the function name.

2, not finished, will continue to improve

JavaScript Learning Tutorials

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.