本文主要是介绍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
这篇关于three pillars of javascript的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!