<!DOCTYPE html><html><head>
<title></title></head><body></body>
<script type="text/javascript">
var obj = { id:"aw", cool:function coolFn(){ console.log(this.id);
}
} var id = 'not aw';
setTimeout(obj.cool,100); </script></html>为什么加了settimeout以后输出的是全局变量的id。
缥缈止盈
随时随地看视频慕课网APP
相关分类