title: If (Var == True) { Do this! }
body: <p>I'm brand new to Javascript.</p>
  
  <p>I'm playing around with some code here and can't get my if to work, but my else works.</p>
  
  <p>The problem is with (solved == true), it's not working. Not sure what I'm doing wrong here.</p>
  
  <pre><code> &lt;script&gt;
          solved = true
      &lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
          function solvedTrue(){
              var solved = true
              console.log("Solved is now " + solved)
      }
      &lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
          function solvedFalse(){
              var solved = false
              console.log("Solved is now " + solved)
      }
      &lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
              function checkStatus(){
              console.log("Currently it's " + solved)
      }
      &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
              function tester(){
                  if (solved = true) {
                  alert('it worked') }
                  else {
                      alert('Did not work')
  &lt;/script&gt;
  
      &lt;button onclick="tester()"&gt;If/Else Test&lt;/button&gt;
      &lt;button onclick="solvedTrue()"&gt;True&lt;/button&gt;
      &lt;button onclick="solvedFalse()"&gt;False&lt;/button&gt;
      &lt;button onclick="checkStatus()"&gt;What's the Status?&lt;/button&gt;
  </code></pre>