Check out example codes for "If statement that tests if a value is in range". It will help you in understanding the concepts better.

Code Example 1

if ((x >= xmin) && (x <= xmax)) {
  // something
}

Learn ReactJs, React Native from akashmittal.com