- Object-Oriented JavaScript(Second Edition)
- Stoyan Stefanov Kumar Chetan Sharma
- 133字
- 2021-08-13 16:19:29
Primitive data types recap
Let's quickly summarize some of the main points discussed so far:
- There are five primitive data types in JavaScript:
- Number
- String
- Boolean
- Undefined
- Null
- Everything that is not a primitive data type is an object
- The primitive number data type can store positive and negative integers or floats, hexadecimal numbers, octal numbers, exponents, and the special numbers
NaN
,Infinity
, and–Infinity
- The string data type contains characters in quotes
- The only values of the Boolean data type are
true
andfalse
- The only value of the null data type is the value
null
- The only value of the undefined data type is the value
undefined
- All values become
true
when converted to a Boolean, with the exception of the six falsy values:""
null
undefined
0
NaN
false
推薦閱讀
- Visual C++程序設(shè)計(jì)教程
- ServiceNow Application Development
- Android開發(fā)精要
- Practical Internet of Things Security
- GitLab Repository Management
- Securing WebLogic Server 12c
- ArcGIS By Example
- 單片機(jī)C語言程序設(shè)計(jì)實(shí)訓(xùn)100例
- Keras深度學(xué)習(xí)實(shí)戰(zhàn)
- 劍指大數(shù)據(jù):企業(yè)級(jí)數(shù)據(jù)倉(cāng)庫項(xiàng)目實(shí)戰(zhàn)(在線教育版)
- 代碼閱讀
- Oracle實(shí)用教程
- ABAQUS6.14中文版有限元分析與實(shí)例詳解
- R語言數(shù)據(jù)挖掘:實(shí)用項(xiàng)目解析
- ASP.NET開發(fā)寶典