js一切都是继承自Object

包括Function,Array,Date等都是继承自Object  而function是Function new出来的对象

new的过程

1.改变了函数内this的指向

2.执行了该函数

3.返回了一个对象

和Object.create过程

function create(o){

var f=function(){}

f.prototype=o;

return new f()

}

js的对象

相关文章:

  • 2022-03-01
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-10-26
  • 2021-12-15
  • 2021-07-05
  • 2021-08-10
相关资源
相似解决方案