title: make a function that Calculates total GPA
body: <p>okay so im suppose to take in an array of grades and then calculate the GPA. It keeps coming up as "Nan" and i forget how to change that... I also don't think my GPA variable is correct.
  "The function must take in one parameter that will contain an array of letter grades (for example, ["A+", "A-", "C", "B-", "A"])
  The funciton must find the current GPA"</p>
  
  <pre><code> var letter = "";
   var GPA;
  
   function calculateTotalGPA(letter) {
       var counter = 0;
       for (var i = 0; i &lt; letter.length; i++) {
           if (letter == "A+") {
               GPA = 4;
               counter++;
           }
           if (letter == "A") {
               GPA = 4;
               counter++;
  
           }
           if (letter == "A-") {
               GPA = 3.67;
               counter++;
           }
           if (letter == "B+") {
               GPA = 3.33;
               counter++;
           }
           if (letter == "B") {
               GPA = 3;
               counter++;
           }
           if (letter == "B-") {
               GPA = 2.67;
               counter++;
           }
           if (letter == "C+") {
               GPA = 2.33;
               counter++;
           }
           if (letter == "C") {
               GPA = 2;
               counter++;
           }
           if (letter == "C-") {
               GPA = 1.67;
               counter++;
           }
           if (letter == "D") {
               GPA = 1;
               counter++;
           }
           if (letter == "F") {
               GPA = 0;
               counter++;
           }
       }
       return (GPA / counter);
   }
  </code></pre>