Search
 
SCRIPT & CODE EXAMPLE
 

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
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react history go back 
Javascript :: placeholder js 
Javascript :: array reverse algorithm in js 
Javascript :: javascript syntax for check null or undefined or empty 
Javascript :: javascript replace 
Javascript :: json.parse what does it do 
Javascript :: click outside react component 
Javascript :: how to create a global variable in vue 
Javascript :: how to hide javascript code 
Javascript :: find the largest number in array javascript 
Javascript :: fetch javascript 
Javascript :: js json stringfy beutify 
Javascript :: disable scroll react 
Javascript :: res.status 
Javascript :: split date 
Javascript :: mock a function jest react 
Javascript :: remove property from javascript object 
Javascript :: javascript array delete by index 
Javascript :: jquery on click fade out element 
Javascript :: how to use bootstrap icons in react components 
Javascript :: jquery count selected options 
Javascript :: sort string 2d array in javascript 
Javascript :: find space in string js 
Javascript :: how to generate unique id in node js 
Javascript :: nested for loop javascript 
Javascript :: check if a column is unique sql 
Javascript :: javascript reverse loop 
Javascript :: convert string time to time in javascript 
Javascript :: jquery window offset top 
Javascript :: connect mongoose from node js 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =