three pillars of javascript
作者:互联网
1.Types & Coercion
Primitive Types
- underfined
- string
- number
- boolean
- object
- symbol
- null
其中 null
,虽然是基本变量,但是因为设计的时候null
是全 0,而object
是 000 开头,所以typeof会误判。
- function - subtype of the object
- array - subtype of the object
NaN 是一个特殊的值,某种程度上表明我们进行了某种无效的数值运算
new 关键字
Use new:
- Object()
- Array()
- Function()
- Date()
- RegExp()
- Error()
Don't use new:
- String()
- Number()
- Boolean()
Converting Types
In Javascript variables don't have types, values do
Checking Equality
2.Scope / Colsures
3.this & Prototypes
标签:function,object,javascript,three,pillars,subtype,new,null,Types 来源: https://www.cnblogs.com/yujiaming890321/p/15868580.html