title: How do I check nested If statements in JavaScipt
body: <p>I'm new to JavaScript, so I'm currently working on a script that is supposed to update a string called <code>Wasl_Status</code>. These are the for conditions I'm trying to check:</p>
  <p>Here is my code so far:</p>
  <pre><code>if (analog2 == 0) {
    return &quot;Tamper Weight&quot;;
  }
  if ((analog1 == 0) &amp;&amp; (speed == 0)) {
    return &quot;Parked Device Disconnected&quot;;
  }
  if ((analog1 == 0) &amp;&amp; (speed &gt; 0)) {
    return &quot;Moving Device Disconnected&quot;;
  if ((ignition == true) &amp;&amp; (speed == 0))
      return 'Parked Engine On';
  if ((ignition == false) &amp;&amp; (speed == 0))
      return 'Parked Engine Off';
  if (speed &gt; 0)
      return &quot;Moving&quot;;
  }
  </code></pre>
  <p>When I test it, the Wasl_Status only outputs the first three conditions and it ignores all the last three conditions. How do I make it to check every condition and return all 6 values? What I read so far is to create an array but current instructions say I must do nested if statements. I hope my question is clear. Thank you.</p>