let user = {
name: 'John',
age: 30,
hi: function(){console.log(this)}
}
user.hi()// Object { name: "John", age: 30, hi: hi() }
-------------------------------------------------------------------
let user1 = {
name: 'John',
age: 25,
hi: () => console.log(this)
}
user1.hi()// window...
-
Вопрос задан
-
103 просмотра