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