面试题一
function A(){ console.log(1) } function Fn(){ A=function(){ console.log(2) } return this } Fn.A=A Fn.prototype ={ A: ()=>{ console.log(3) } } A(); Fn.A(); Fn().A(); new Fn.A(); new Fn().A() new new Fn().A();
答案是: 1,1,2,1,3, error(箭头函数不能被new)