title: The prompt part works but not the if-else conditions inside the function. What did I do wrong?
body: <p>I'm trying to display an alert that says what kind of triangle it is with the inputs from the prompt but the if-else conditions won't work when I put it inside a function. If it isn't inside a function it works fine but it is a requirement to put it inside.</p>
  <p>tried this and only the prompt part works</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
      &lt;script&gt;
          var a = prompt(&quot;Enter the length of side A: &quot;);
          var b = prompt(&quot;Enter the length of side B: &quot;);
          var c = prompt(&quot;Enter the length of side C: &quot;);
          
          function determineTriangle(a, b, c) {
          if (a == b &amp;&amp; b == c){
              window.alert(&quot;The triangle is EQUILATERAL&quot;)
          }
          
          else if (a == b || b == c || c == a){
              window.alert(&quot;The triangle is ISOSCELES&quot;);
          }
          
          else{
              window.alert(&quot;The triangle is SCALENE&quot;);
          }
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I've encountered a new problem. I need to use the isNan() function to check if the input is a number and I added this part</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
      &lt;script&gt;
          var a = prompt("Enter the length of side A: ");
          var b = prompt("Enter the length of side B: ");
          var c = prompt("Enter the length of side C: ");
          
          if (isNan(a)) {
              window.alert("You did not enter a number")
          }
          else {
          determineTriangle(a, b, c)
          }
          
          if (isNan(b)) {
              window.alert("You did not enter a number")
          }
          else {
          determineTriangle(a, b, c)
          }
          
          if (isNan(c)) {
              window.alert("You did not enter a number")
          }
          else {
          determineTriangle(a, b, c)
          }
  
          function determineTriangle(a, b, c) {
          if (a == b &amp;&amp; b == c){
              window.alert("The triangle is EQUILATERAL")
          }
          
          else if (a == b || b == c || c == a){
              window.alert("The triangle is ISOSCELES");
          }
          
          else{
              window.alert("The triangle is SCALENE");
          }
          }
          determineTriangle(a, b, c);
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>and It doesn't work again.</p>