Advertisement
Sparkster

Untitled

Nov 6th, 2013
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var userAge = parseInt(prompt("I am the message! Number me: "), 10);
  2.  
  3. if(isNaN(userAge)) {
  4.     console.log("Not a number!");
  5. }
  6.  
  7. else if(userAge >= 18) {
  8.     console.log("Too young! Yuck!");
  9. }
  10.  
  11. else {
  12.     console.log("Welcome treehugger!");
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement