if statement for number range js code example Example: If statement that tests if a value is in range if ((x >= xmin) && (x <= xmax)) { // something }