Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // %
- function mod(num, by) {
- var tmp_num = num;
- while (tmp_num - by >= 0) {
- tmp_num -= by
- }
- return tmp_num;
- }
- function fizzbuzzMod (limit) {
- for (var i = 1; i <= limit; i++) {
- if (i % 15 === 0) console.log('fizzbuzz');
- else if (i % 3 === 0) console.log('fizz');
- else if (i % 5 === 0) console.log('buzz');
- else console.log(i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement