2020
10-08
10-08
深入理解 ES6中的 Reflect用法
Reflect对象是一个全局的普通的对象。Reflect的原型就是Object.我们首先来验证下看看Reflect的原型是否是Object,基本代码如下:letobj={};console.log(Reflect.__proto__===Object.prototype);//trueconsole.log(obj.__proto__===Reflect.__proto__);//trueletstr='111';console.log(str.__proto__);//String{"",length:0,constructor:ƒ,anchor:ƒ,big:ƒ,blink:ƒ,…}Reflect是ES...
继续阅读 >