Q:

How can I calculate the number of grades that are entered by the user are in the range of 70-90?

I am using echo printing to show grades that user enters. If the number entered is not between 0-100 it will show the user that "You entered an invalid number".
I want to calculate how many grades are in the range of 70-90 that the user inputs.
if((input) || input == "" || input < 70|| input > 90)
          {
             range = range + 1;
          }  

I have this statement to calculate the numbers of grades that are between 70-90
document.writeln("<h1 style= \"color: magenta\"> The number of valid grades entered is " + counter + ".<br />The number of grades entered that are between 70-90 are: " + range + ".</h1>");

This is the code that displays it.
But it is not always correct. Where should I put the if statement above or should I change it?

A:

If you want to check that a number is between the min and max of the range, you would likely want to check that it is both higher than the min (input > 70) and (&&) lower than the max (input < 90):

var grades = [28, 39, 42, 56, 63, 71, 76, 80, 92, 99, 100];
var min = 70;
var max = 90;

var inRange = grades.filter(function(input) {
  return input > min && input < max;
}).length;
console.log(inRange + ' of the ' + grades.length + ' are in between ' + min + ' and ' + max + '.');

