对象
某个特定引用类型的实例,把数据喝功能组织到一起的结构。新对象通过使用new操作符跟一个constructor来创建。构造函数就是用来创建新对象的函数。
基本引用类型
- Date
使用new操作符来调用Date构造函数。
- RegExp
ECMAScript通过RegExp类型支持正则表达式。
g:全局模式
i:不区分大小写
m:多行模式
y:黏贴模式
u:Unicode模式
s:dotAll模式
RegExp 实例属性
global
ignoreCase
unicode
sticky
lastIndex
dotAll
source
flags
RegExp实例方法
exec()
RegExp构造函数属性
input $_
lastMatch $&
lastParen $+
leftContext $`
rightContext $'
原始包装类型
- Bollean
- Number
- String
单例内置对象
- Global
全局上下文存在两个内置对象:GLOBal Math,Global对象在大多数ECMAScript实现中无法访问,浏览器将其视作为window对象。所有全局变量和函数都是Global对象的属性。
URL编码方法 encodeURI() encodeURIComponent() decodeURI() decodeURIComponent()
eval()
-
Math
1.Math对象属性 Math.E 2.min() max()数组中最大最小 3.舍入 Math.ceil() Math.floor() Math.round() Math.froound() 4.random