There are 7 types of data:
undefined
(Not defined)
null
(empty),
boolean
(Boolean type)
string
String
symbol
(symbol),
number
Digital
object
Object
Naming rules
Variable
The name of (a variable) can be a number, a letter, $
or a _
composition, but not a space or a number headed.
Attention:
When a variable in JavaScript is declared, the inside of the program gives it an initial value undefined
. When you perform an operation on a variable that is a value undefined
, the result will be NaN
, "not a number NaN
". When you use a non 定义
-variable to do a string connection operation, it will output truthfully "undefined"
.
All variables in JavaScript are case-sensitive. This means that you have to treat the uppercase and lowercase letters differently.
"your name"
is called a string . A string is a series of 0 or more characters wrapped in single or double quotation marks.
In JavaScript, you can \
escape quotation marks by using a backslash () in front of the quotation marks.
Data types and naming conventions in JavaScript