ui.title.addEventListener('click', ui.showThis)
ui.title.addEventListener('click', () => {
ui.showThis();
})
I have a keyup event on an input field in my application that calls a function in my UI Controller module
showThis(){
console.log(this);
}
which logs the value of this when the input field is clicked.
Why is it that the value of 'this' is different when the function is called within a callback function on the event listener vs. when the function is itself passed as the callback?