() => {console.log(this)})
// this -> element
element.addEventListener("change", function() {console.log(this)})
Why arrow function behaves differently ?
Because arrow functions don't create a scope for "this", instead it inherits it from its parent
Обсуждают сегодня