<script?type="text/javascript">
var?name?=?'The?Window';
var?object?=?{
????name:?'My?Object',
????getNameFunc:?function(){
????????return?function(){
????????return?this.name;
????????}
????}
}
console.log(object.getNameFunc()());
</script>為什么打印的結果是The?Window,而不是My?Object?????求高手指教。
關于閉包this指向問題
Sunshine518
2019-08-09 09:26:55