title: multiple if but only runs the first one? javascript
body: <p>so I wrote this for my first computer science class assignment. However, the page returns that if input is <code>gpa(A)</code>, the results is <code>3</code>. It's like only the first conditionals <code>if</code> is running. I switched around the <code>A</code>, <code>B</code> ,<code>C</code> and <code>2</code>, <code>3</code>, <code>4</code> but it's always the first <code>if</code> no matter what the <code>gpa(r)</code> is. How does this happen?</p>
  
  <pre><code>    var gpa = function(r) {
          if (r = "B"){
              return 3;
          } 
          if (r = "C"){
              return 2;
          }
          if (r = "A"){
              return 4;
          }
       }
  </code></pre>