Advertisement
zachdyer

Hello World in Javascript

Jul 3rd, 2014
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Tips for beginners
  2. //Always keep your code simple
  3.  
  4. //Setting hello to hello
  5. var hello = "hello";
  6. //Setting world to world
  7. var world = "world";
  8. //Check if spelled right
  9. if(hello == "hello"){
  10.     //Check if world spelled right
  11.     if(world == "world"){
  12.         console.log(hello.toUpperCase() + " " + world.toUpperCase() + "!");
  13.     } else {
  14.         //Handle errors
  15.         console.log("You didn't spell world right. You might try Googling it.");
  16.     }
  17. } else {
  18.     //Handle errors
  19.     console.log("You didn't spell hello right. Google how to spell hello.");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement