JavaScript Definitive Guide (sixth Edition)--Chapter 4th

Source: Internet
Author: User

4. Expressions and operators

JavaScript primitive expressions contain constants or direct quantities, keywords, and variables

Initialization expressions for objects and arrays

var matrix = [[1,2,3],[4,5,6],[7,8,9]]; var p = {x:2.4,y:1.2};

function definition expression defines a JavaScript function

var function (x) {return x * x;}

Property-Access Expression

Expression.identifierexpression[expression]

A call expression in JavaScript is a syntax hint that invokes (or executes) a function or method

An object creation expression creates an object and invokes a function called a constructor that initializes the properties of the new object

In operator

The in operator wants its left operand to be a string or can be converted to a string, hoping that its right operand is an object

The expression returns true if the object on the right has a property value named left operand value.

instanceof operator

The instanceof operator expects the left operand to be an object, and the right operand identifies the class of the object

If the object on the left is an instance of the right-hand class, the expression returns true, otherwise false is returned.

JavaScript Definitive Guide (sixth Edition)--Chapter 4th

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.