title: How do I use if, else if and else statements to validate two strings
body: <p>I'm very new to JavaScript, and I'm keen to learn. What I'm trying to do is play with the if, else statements. I'm trying to validate two types of strings. I can't seem to validate the numbers, and I can not figure it out for the life of me. Any hints would be greatly appreciated please.   </p>
  
  <p></p>
  
  <p>
      <h1>JavaScript : typeof example</h1></p>
  
  <pre><code>&lt;script&gt;
      var string1 = 'w3';
      var string2 = (1); 
  
      if (typeof string1 == 'w3') {
          document.write(string1 + " is a number &lt;br/&gt;");
          else if (typeof string2 == (1) {
              document.write(string2 + "is a number &lt;br/&gt;");
          }
      } else {
          document.write(string2 + " is not a number &lt;br/&gt;");
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>