JavaScript Advanced compilation Notes Chapter II, chapter III

Source: Internet
Author: User

1. Script Tag location: General in the head tag, loading the page must wait for the page to download the corresponding JS before rendering the interface;
Workaround 1. Place the body tag inside 2. Or use Window.onload=function ({});

2 Case-sensitive: A special keyword that indicates a null value. JavaScript is case-sensitive, so null and NULL, NULL, or other variables are completely different
3 identifier: Function name, variable, property name, or parameter of the function
1. Alphanumeric underlined dollar sign $, 2 first character must be letter, underscore, or $;
4 Note 1. Single-line comment//;2 Multiline comment/* content */statement end with a semicolon identifier;

The 5 variable JS variable is loosely typed to hold any type of data; definition: use var A; Use const to define read-only constants;

6 Data Type 1 Boolean value: Ture false;
2 number numeric type for example: 42 or 3.14159.
3 String type For example: "Howdy"
4 Object Type
5 NULL
6 undefined undefined variable or only unassigned;
The typeof operator is not a function; You can determine the data type of the variable
1.undefined----variable undefined or undefined
2.boolean---boolean value
3.string--String type
4.number--Value
5.object--Object or null
6.function--function
7 1 NaN judgment with isNaN (); alert (Nan==nan); return false;
2 string containing the Var lang= ' Java ' in single or double quotation marks; lang=lang+ ' script ';
Two ways to convert a value into a string
1 toString (); null and undefined; without this method; Usage: var num=10;alert (num.tostring ());
2 String (); The conversion rule if the method is called by the ToString () method, if NULL returns NULL, if undefined returns undefined;

8object type
Creation of objects
1 var obj= new Object (); If you do not pass parameters, you do not need to use parentheses;

9 Common Operators && | | ! = = = = = = and three mesh operations

JavaScript Advanced compilation Notes Chapter II, chapter III

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.