Basic data types and expressions for JavaScript

Source: Internet
Author: User

underlying data types and expressions for Java scriptBasic data types:number (numeric) Type: can be divided into integers and floating-point numbersstring (character) type: is indicated by single quotation mark "'" or double quotation mark "" ". Boolean (Boolean) Type: The value of Boolean type True (yes) or false (wrong). null and Undefined:null represent a value of "null", Undefind indicates that the value is undefined, &&: With operations, only the result of all true,&& operations is true. || : or arithmetic, as long as one of the true,| | The result of the operation is true. ! : Non-operation, is a single-mesh operator that turns true to false and false to true. Compare:"= =" Compare auto jump data type in comparison"= = =" does not automatically jump the data type, if the data type is different, returns Fales if the comparison is consistent. It's best not to compare "= ="NaN:  Basic constants:character constants: One or more characters that use the single quotation mark "" or the double quotation mark "" to enclose the gas.  A string: the character that is represented by or enclosing it, and if it is also a character, it can be enclosed, such as "I m OK" if the string contains and contains both, and can be identified with an escape character. escape characters: \ Can escape many characters, \ n means newline, \ t represents a tab, and if the character \ itself is escaped, use \ \. Template string: You can use the + number to connect multiple strings together. lengthaction string: To get a character specified as a position, the index number is from the beginning.toUpperCase:toUpperCase () capitalizes a string. toLowerCasetoLowerCase () puts a string all lowercase. indexOfindexOf: Searches for the location where the specified string appears. substringsubstring () returns the substring of the specified index, such as the [) interval. Stack Heapimmutable primitive values and mutable object referencesthe original values of JavaScript (Undefind, NULL, Boolean, number, and string) are fundamentally different from objects, including arrays and functions. The original value is immutable and cannot be changed anywhere, and all methods in the string appear to return a modified string, actually returning a new string value;  

Basic data types and expressions for JavaScript

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.