JavaScript can handle some data types from the real world. For example: numbers and text.
At the same time, JavaScript also includes some
Data types that have an abstract nature. such as object data types.
JavaScript It is a weakly typed language. Very many cases. When we are working with the data. There is no need to declare the type of data. JavaScript can self -
The type of their own.
since JavaScript is a weakly typed language, do we not have to discuss data types? In fact, in some cases, errors can occur, or JavaScript's
Judgment is inconsistent with your assumptions. In these cases, we need to display the type of declarative data in JavaScript.
Next we discuss several commonly used data types for javascript: numeric type, String type, Boolean type
First, numeric type
1) Integers: For example 1, 2, 3,-1,-2, etc., integers can be positive and can be negative. The range is -2^53~~2^53.
2) Score: for example 2.3, 4.3, etc., ibid, can be positive can also be negative.
In the actual use. You don't have to care about the range of values in JavaScript, and JavaScript sees them as floating-point types.
ii. Text Data
In JavaScript. A string is a text enclosed in a "(citation)", for example, "Hello World", "123".
There are many special characters that are not directly entered in JavaScript, and we need to use escape characters to represent them. We use Represents a space character, the following is how some escape characters are used:
Escape Character Series escape character represents meaning
\b Backspace
\f Page Break
\ n line break
\ r return character
\ t tab (tab)
\ ' Single cited
\ "Double-cited
\ \ Backslash
\xnn the NN is a hexadecimal number. Represents the number of characters in the Latin-1 character set
Third, Boolean data
The value of the JavaScript Boolean type is: true means "yes". False indicates yes "no"
Reprint Please specify source: http://blog.csdn.net/hai_qing_xu_kong/article/details/40735895 Emotional Control _ Click to open link
JavaScript Language Basics 3