Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function printNumbers(n) {
- var exist = false;
- var result = '';
- for (var i = 1; i <= n; i+=1) {
- if(i % 4 !== 0 && i % 5 !== 0) {
- exist = true;
- result += i + ', ';
- }
- }
- return exist ? result : 'no';
- }
- console.log(printNumbers(20));
- console.log(printNumbers(-5));
- console.log(printNumbers(13));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement