Guest User

Untitled

a guest
May 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Add an else statement in case the number is divisible by 5.
  2.  
  3. // for the numbers 1 through 20,
  4. for (i=1; i<=20; i++) {
  5.  
  6.   // if the number is 15, write "Fizzbuzz"
  7.   if ( i === 15; ) {
  8.       console.log("Fizzbuzz");
  9.     }
  10.  
  11.   // if the number is divisible by 3, write "Fizz"
  12.   else if ( i % 3 === 0 ) {
  13.     console.log("Fizz");
  14.   }
  15.  
  16.   // if the number is divisible by 5, write "Buzz"
  17.   else if ( i % 5 === 0 ) {
  18.     console.log("Buzz");
  19.   }
  20.  
  21.   // otherwise, write just the number
  22.   else {
  23.     console.log(i);
  24.   }
  25. }
  26.  
  27. // SyntaxError: missing ) after condition
Add Comment
Please, Sign In to add comment