I want to have a function that takes an event as a parameter and checks if a valid event object has passed.
function doSomething(e){
if(e is a keyboard event){
} else {
console.log('Error: e is not a KeyboardEvent');
}
}
typeof ejust returns object. But the debug console shows KeyboardEvent clearly, so you need to read it somehow.
source
share