MV Small Math Problem That's Probably Dumb

Hey there fellow game devs, so I am probably being really stupid here, but I need a way to check all the numbers in between x and y.

For example, say that x=10 and y=1. I need a way to check if ____ is equal to all the numbers between 10 and 1. There's probably a really easy math function to do this, but I can't seem to figure this out. Thanks for your help, and sorry if my question is dumb...
How can one number be equal to all numbers between x and y o_0 Maybe I'm too dumb to understand your question ._.
Edit:
I eventually realized your question might be about to check if n exists within an array.
If that's the case, it's like this:
JavaScript:
var a = [10, 20, 30, 40, 50, 60, 70, 80, 90 ,100]//the list of numbers to check among
var n = 50; //the number to check for
for (i=0; i<a.length; i++){
if (n==a[i]){ //Checking if n is equal to any of the numbers from start to finish
console.log(a[i]); //if it is, do something like print the number. Will print 50.
}
}
what are you checking? an array or a number?

because only an array can be equal to all the (multiple) numbers between two limits.
if you're checking a number, it can only be equal to one of the numbers between the two limits.

and in the second case I would simply make two checks, if it is larger or equal to the lower number and lesser or equal to the higher number
It would probably be helpful to also have some context as to what you are trying to achieve with this
function. So that we can better understand the whole spectrum of your problem.
Ah, yes, @Andar, that is what I wanted to achieve, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/small-math-problem-thats-probably-dumb.129857/