当前位置:网站首页>7、 JS data type
7、 JS data type
2022-06-13 08:34:00 【001128XY】
Why is there a concept of data type ?
In order to use memory space more reasonably
1、 Basic data type
1、string
Wrap in single or double quotation marks , Single quotation marks and double quotation marks can be nested with each other , But you can't nest yourself , If you really need to nest , You can use escape characters
2、number
stay JS in , Don't distinguish between decimals and integers , All are number type
Special values :
Maximum :Number.MAX_VALUE
minimum value :Number.MIN_VALUE
infinity :Infinity 10 / 0
An infinitesimal :-Infinity -10 / 0
Illegal number NaN
JS When calculating a value, no result is returned , Then return to NaN, Any number and NaN Calculation , Are all NaN,NaN Compare with any number , Are all false, Determine whether a variable is NaN, adopt isNaN()
3、boolean
Values are true and false Two , Some data will have implicit conversion of data type at some time
4、und
It's a data type , There is only one value corresponding to this data type , yes und
// Later, it is generally used to judge whether a variable has a value
var x;
console.log(x); //undefined
5、null
- Null Represents an empty... Of a reference data type
- Represents an empty object , use typeof Check null Will return a object
- use : Through the assignment null This special value , To make the system clear the reference of variables to objects
6、und And null The difference between
- und and null Both are empty
- und Represents the null of the basic data type
- null Represents an empty... Of a reference data type
- Both indicate that the stored content is empty , Determine whether the two values are equal , The result is true.
Equal sign :==
Determine whether the operands on both sides are equal
In judgment , Do implicit type conversion first , Will be able to null and und All turned into false
The final judgment is false == false
Absolutely equal to :===
At this point, it first judges the type , If the types are inconsistent , The result is false
边栏推荐
- PHP isset() method ignores data error handling caused by null parameter value
- The method of SolidWorks modifying text font in engineering drawing
- Why do wholesalers use the order system
- MySQL sorts according to the specified order of the specified fields
- LVM management exercise
- VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案
- Request alarm: refer policy: strict origin when cross origin or reference site policy: no refer when downgrade
- 名次的确定
- Notes on MySQL transaction not automatically submitting
- 杨氏矩阵查找数字是否存在
猜你喜欢

Installing pytorch under Anaconda

When submitting the laravel admin form and using the required verification, an error is reported when the value is 0

ERP basic data Kingdee
![[game theory complete information static game] Nash equilibrium](/img/db/9923f5a7465c8b57182f09810b65bf.jpg)
[game theory complete information static game] Nash equilibrium

How to use annotations in word

学习记录4: einops // cudnn.benchamark=true // hook

Why do wholesalers use the order system

MySQL parsing serialized fields

Phpexcel 10008 error resolution

Svg text stroke effect
随机推荐
Several precise order receiving methods suitable for fresh food wholesale industry
[pychart pit stepping record] prompt after configuring remote operation, [errno 2] no such file or directory
微服务项目搭建三:自动生成代码
Sizeof, strlen find character length
Process and scheduled task management
Bidirectional retransmission step experiment
JS - for cycle case: Horse grain
Mongodb test case
Wrap dynamically created child elements in dynamically created structures
How about a well-known food material distribution information management system?
Maternal and infant supplies wholesale industry uses management software to improve efficiency and realize cost reduction and efficiency increase
Dest0g3 520 orientation
JS - max. of array cases
Namespace in TS (2)
How to modify desktop path in win10 system
Filebeat collects logs to elk
Buuctf web (VI)
Edge browser uses bdtab new tab plug-in (BD new tab)
0.一些自己初学Solidworks的疑惑
The method of SolidWorks modifying text font in engineering drawing