JavaScript data types and operators

Source: Internet
Author: User
Tags bitwise

ECMAScript is the basis for JavaScript implementations

A complete JavaScript implementation consists of the following 3 distinct components:

• Core (ECMAscript)
• Document Object Model (DOM)
• Browser object Model (BOM)
· JavaScript is an object-based


JS has two major data types:
1. Basic data types
2. Custom data type (content exists stack memory, address exists heap memory)

------------------Five basic data types of JS--------------
1.Number includes integers and floating-point numbers
2.String string
3.boolean:true false True is 1 false is 0
4.undefined:undefined If a variable is declared but is assigned to him, the variable type is Undefined and the value is Undefined
5.null:null

------------------Data type Conversions------------------
string and number stitching, converting numbers into strings
Parseint () forcibly converted into integral type
Nan when a string fails to convert to a number
Nan in an expression, the result must be false, except! =
Parsefloat () forcibly converted to floating-point type
Eval () converts a string into an expression
typeof () View data type

------------------operator--------------------
Arithmetic: +-*/%
Increment Decrement: + +--
Unary plus subtraction: =+ =-can convert numbers, strings into numbers
Assignment: =
Logic: = =, = =, >, <, >=, <=,! =, &&, | |,!
Bitwise operation:<< (shift left) >> (right Shift)-(negation) all multiplication are implemented in the bottom binary, so the direct bit operation is very fast
Bitwise AND:& bitwise OR: | | xor or ^

JavaScript data types and operators

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.