Jacascript expression, operator, statement, strict mode, jacascript expression

Source: Internet
Author: User

Jacascript expression, operator, statement, strict mode, jacascript expression
Expression {// key-valuex: 1; y: 2 ;}
[1, 2] Three undefined
Var o = new Object (); {o. x = 1; o. y = 2;} o. x = o ['X'] (the property name is automatically converted to a string)
Special operator C? A: bvar val = (, 3) calculates the expression from left to right, and finally obtains the rightmost value delete obj. x; Delete attributes (can be deleted without going through the prototype chain up, And retriable = true) in 'X' in window going up through the prototype chain, return true/falsevoid () and return undefined

Statement block (block of code enclosed by braces)
{A: 1, B: 2} SyntaxError is the default block var o = {a: 1, B: 2} // correct because the braces start.
No block-level scope, function, and scope! In one sentence, the variables declared in the block are global (variables in if/else/for/while/try-catch). The variables declared in the function cannot be accessed outside the function. Special: function o () {var a = B = 1; // a is a local variable in the function, B is a global variable, B = 1 first, and then a = B}
Try-catch-finally an exception must be handled with catch only once. When no catch occurs in the internal layer, execute finally in the inner layer and then jump to the outer layer to execute catch.
Function preprocessing the declaration of functon function will be pre-processed so that the for-in traversal with function can be called anywhere in the full text, which is equivalent to a new variable.
Strict mode function fun () {'use strict '...} or declare strict mode in the entire js File



Video Teaching Resource http://www.imooc.com/video/6002

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.