Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var theArray = [];
- for (var n = 1; n <= 100; n++) {
- if (n % 15 == 0) {
- theArray[theArray.length] = "FizzBuzz";
- }
- else if (n % 5 == 0) {
- theArray[theArray.length] = "Buzz";
- }
- else if (n % 3 == 0) {
- theArray[theArray.length] = "Fizz";
- }
- else {
- theArray[theArray.length] = n;
- }
- }
- for(theEntry: theArray)
- {
- print(theEntry);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement