title: SyntaxError: Unexpected token var in my js code
body: <ol>
  <li>I am trying to finish a small js task, wrote the code but I am
  getting a SyntaxError: Unexpected token var . Can you guys tell me what error is in it.?</li>
  <li>Modify the StudentReport class so that no grades will be printed to
  the console in the for-in loop.</li>
  <li>However, getGPA should still function properly in the last line.</li>
  </ol>
  
  <hr>
  
  <pre><code>function StudentReport() {
      var grade1 = 4;
      var grade2 = 2;
      var grade3 = 1;
      var getGPA = function() {
          return (var grade1 + var grade2 + var grade3) / 3;
      };
  }
  
  var myStudentReport = new StudentReport();
  
  for(var x in myStudentReport) {
      if(typeof myStudentReport[x] !== "function") {
          console.log("Muahaha! " + myStudentReport[x]);
      }
  }
  
  console.log("Your overall GPA is " + myStudentReport.getGPA());
  </code></pre>