Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Codewars JS Multiples of 3 or 5

function solution(number) {
    let answer = 0
    for (let i = 0; i < number; i++) {
        if (i % 3 == + 0 || i % 5 === 0) {
            answer += i
        } else {
            continue;
        }
    }
    return answer
}
 
PREVIOUS NEXT
Tagged: #Codewars #JS #Multiples
ADD COMMENT
Topic
Name
9+2 =