im doing a basic calculator to learn JS. Right now im making an if condition that if the button pressed is NOT a number, then do something. While i was writing it i wondered if there's a way of doing something like this (of course THIS exact sintaxys does not exist, i know that, but I think you'll understand what im looking for)
if (buttonPressed.innerText != "1,2,3,4,5,6,7,8,9,0")
or anything similar, so i can avoid doing writing:
if (buttonPressed.innerText != "1" && buttonPressed.innerText != "2" && buttonPressed.innerText != "3" , etc)
basically, an easier and faster way of writing multiple conditions to avoid such an extensive text. i tried googling this but since Spanish is my main language and not English i dont know how to formulate this question briefly to work on google. Thanks in advance :)