bind小题目

let father = {};
let son = {};
function show(){
    console.log(this);
    return this;
}

let newShow = show.bind(father);
let newShow1 = newShow.bind(son);
console.log(newShow);
console.log(newShow1);
console.log(newShow() === father);
console.log(newShow1() === son);

猜你喜欢

转载自blog.csdn.net/dreamjay1997/article/details/82763052