A Pen by Dave Edwards on CodePen.
A Pen by Dave Edwards on CodePen.
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| if(isset($_POST['zipcode']) && is_numeric($_POST['zipcode'])){ | |
| $zipcode = $_POST['zipcode']; | |
| }else{ | |
| $zipcode = '50644'; | |
| } | |
| $result = file_get_contents('http://weather.yahooapis.com/forecastrss?p=' . $zipcode . '&u=f'); | |
| $xml = simplexml_load_string($result); | |
| //echo htmlspecialchars($result, ENT_QUOTES, 'UTF-8'); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Write your code below! | |
| var userAge = parseInt(prompt("What is your age"), 10); /* parseInt forces the input of the prompt to be parsed through as an integer and 10 rounds it up to a whole number | |
| if (userAge.isNaN){ /* isNaN checks to see whether the input is a number*/ | |
| console.log("Not a number"); | |
| } | |
| else if(userAge>=18){ | |
| console.log("You are over 18"); | |
| } |