Skip to content

Commit 462b50a

Browse files
authored
Create Multiplesof3and5.js
1 parent 8362511 commit 462b50a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Multiplesof3and5.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function multiplesOf3and5(number) {
2+
3+
let numsum = [];
4+
for(let i=0; i < number; i++){
5+
if(i%3==0 || i%5==0){
6+
numsum.push(i)
7+
}
8+
}
9+
10+
return numsum.reduce((a,b) => a + b,0);
11+
}
12+
13+
multiplesOf3and5(49);

0 commit comments

Comments
 (0)