title: How to catch invalid input in javascript
body: <p>How can the following logic be implemented in javascript:</p>
  
  <p>According to the description of R-rated films: Children under 17 require an accompanying parent or adult guardian (age 21 or older) and adults 25 years and under must show ID. And children under the age of 6 are not allowed in after 6:00pm.</p>
  
  <p>Deadpool is an R-rated movie.</p>
  
  <p>Write a JavaScript function named canIWatch that will take age as a parameter.</p>
  
  <p>If the age is less than 6, return You are not allowed to watch Deadpool after 6.00pm.</p>
  
  <p>If the age is 6 or more but less than 17, return You must be accompanied by a guardian who is 21 or older.</p>
  
  <p>If the age is 17 or more but less than 25, return You are allowed to watch Deadpool, right after you show some ID.</p>
  
  <p>If the age is 25 or greater, return Yay! You can watch Deadpool with no strings attached!.</p>
  
  <p>If the age is invalid, return Invalid age.</p>
  
  <p>I have written the following code but still can't pass the test, what am I doing wrong?</p>
  
  <pre><code>function canIWatch(age){
    if(age&lt;6){
      return 'You are not allowed to watch Deadpool after 6.00pm.';
    }
    else if(age&gt;=6 &amp;&amp; age&lt;17){
      return 'You must be accompanied by a guardian who is 21 or older.';
    }
    else if(age&gt;=17 &amp;&amp; age&lt;25){
      return 'You are allowed to watch Deadpool, right after you show some         ID.';
    }
    else if(age&gt;=25){
      return 'Yay! You can watch Deadpool with no strings attached!';
    }
    else if(!age){
      return 'Invalid age.';
    }
  }
  </code></pre>
  
  <p>I am getting an error :
  canIWatch tests should return an appropriate message if provided age is invalid</p>
  
  <p>Expected 'You are not allowed to watch Deadpool after 6.00pm.' to equal 'Invalid age.'.</p>