I'm using an eventListener to detect numeric options in my vue app:
window.addEventListener("keydown", function (e) {
switch (e.key) {
case 1:
// do stuff
break;
case 2:
// do other stuff
}
}
Since I have more than 9 options, I was wondering what the most sensible way would be to differentiate if the user is entering a one or two digit numer (e.g., 1 vs 11)?