Dexter’s first javascript program

Dexter has been doing online programming lessons on http://codecademy.com and he’s finished up the beginner segment… on to function definitions!

var dex=(prompt("chose a number"));
for (i=1;i<=dex;i++) { if(i%3===0) // divisible by 3 { if(i%5===0)// divisible by 5 - fartface { console.log("FizzBuzz"); } else { console.log("Fizz"); } // end of divisible by 5 if - fartface } //div by 3 if else if(i%5===0) { console.log("Buzz"); } // div by 3 else if else { console.log(i); }//end of div by 3 if }//end of for

Leave a Reply