SHARE
TWEET

Untitled

a guest Oct 12th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solution(number){
  2.   var answer = 0
  3.   var counter = [];
  4.   var i = 1;
  5.   while (i<number){
  6.     counter.push(i)
  7.     i++
  8.   }
  9.   for ( j = 0; j < counter.length; j++) {
  10.     if (counter[j] % 3 === 0 || counter[j] % 5 === 0) {
  11.       answer += counter[j]
  12.     }
  13.     }
  14.     console.log(answer)
  15.   }
RAW Paste Data
Top