Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

buzz fizz javascript

// Buzz fizz javascript
function fizzBuzz(){
    for(let i=1; i<=100; i++){
 if(i % 3 === 0 && i % 5){
        console.log("fizzBuzz")
    }
    if else (i % 3 === 0){
        console.log("fizz")
    }else if(i % 5 === 0){
        console.log("Buzz")
    }else{
        console.log(i)
    }
    }
}
fizzBuzz()
Comment

fizz buzz program in javascript

//Fizz buzz
/* Divisible by 3 = fizz*/
/* Divisible by 5 = buzz*/
/* Divisible by both = fizzBuzz*/
// range 100

for(let numberRange = 1; numberRange <= 100; numberRange++){
    if(numberRange % 3 === 0 && numberRange % 5 === 0) {
        console.log('fizzBuzz');
    }else if(numberRange % 3 === 0){
        console.log('fizz');
    }else if(numberRange % 5 === 0){
        console.log('buzz')
        ;
    }else {
        console.log(numberRange);
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Material-ui Accessible icon 
Javascript :: react router redirect with query params 
Javascript :: angular disable select dropdown 
Javascript :: get all a elements javascript 
Javascript :: datatable set row id 
Javascript :: js how to calculate factorial 
Javascript :: svg to png base64 javascript 
Javascript :: export app react native 
Javascript :: fetch data with axios in reactjs 
Javascript :: nextjs react native web typescript 
Javascript :: Self Invoking Function Simpler Syntax 
Javascript :: multiple export in react 
Javascript :: Appending the option element using jquery each function 
Javascript :: form.reset function in javascript 
Javascript :: path module js 
Javascript :: rect to rect collision 
Javascript :: react router dom v6 private route 
Javascript :: discord button 
Javascript :: for of javascript 
Javascript :: import error in react 
Javascript :: inject js on button click chrome extension 
Javascript :: how to toggle fa fa-caret-down and fa fa-caret-up using jquery 
Javascript :: gatsby tailwind 
Javascript :: pass param to url retrofit 
Javascript :: js group objects in array 
Javascript :: react get url params in class component 
Javascript :: convery array of objects to map using immutables js 
Javascript :: this.props undefined react native 
Javascript :: shorthand if statement js 
Javascript :: javascript get params from query string json object 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =