一个js的小demo
function sayHi(person) {
const name = person.name;
setTimeout(() => {
alert('Hello, ' + name);
}, 3000);
}
let someone = { name: 'Dan' };
sayHi(someone);
someone = { name: 'Yuzhi' };
sayHi(someone);
someone = { name: 'Dominic' };
sayHi(someone);
上面的这个例子中,浏览器会发生什么?
还没有任何评论,你来说两句吧