Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. var myArray = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
  2.  
  3. for(key in myArray) {
  4. if(item % 3 == 0) {
  5. console.log("Fizz");
  6. }
  7. else if(item % 5 == 0 {
  8. console.log("Buzz");
  9. }
  10. else if ( (item % 3 == 0) && (item % 5 == 0) ) {
  11. console.log("FizzBuzz");
  12. }
  13. else {
  14. console.log(i);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement