I opened the Developer Tools in Google Chrome, pasted the following code in console and pressed Enter:
document.removeEventListener(`keypress`, a1);
document.addEventListener(`keypress`, a1);
function a1(event){
console.log(`I should have been called only once`);
}
Then I pressed some key...
Guys, I just don't get it. I don't see ANY logics here. Could you help me?
function it_makes_no_sense_whatsoever(event){
console.log(event.keyCode);
console.log(event.keyСode==37);
console.log(event.keyСode===37);
console.log(parseInt(event.keyСode)==37)...