AlfatArdiansa

Codewars w Sandhika 13

Dec 5th, 2020
700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solution(number) {
  2.   let sum = 0;
  3.   for (let i = 1; i < number; i++) {
  4.     if (i % 3 == 0 || i % 5 == 0) {
  5.       sum += i;
  6.     }
  7.   }
  8.   return sum;
  9. }
  10.  
  11. console.log(solution(10), 23);
  12.  
Add Comment
Please, Sign In to add comment