Is there a better way to write || in a single if statment [duplicate]

2

was wondering if there is a better way to write the code below. I want my if statement to ignore all of the keycodes. but seems quite a messy way to write it as below.

thanks!

if (event.keyCode === 9 
   || event.keyCode === 91 
   || event.keyCode === 20 
   || event.keyCode === 18 
   || event.keyCode === 17 
   || event.keyCode === 37)
Share
Improve this question
0

Comments

Popular posts from this blog

flutter websocket connection issue

React-native : Unable to use react-native-fast-image

reinterpret_cast bug or UB? [duplicate]