Intro to Objects 1 # 3 ...and the good


Intro To Objects 1, #3 ...And the good.

Oops try again. You printed Fizzbuzz when you should have printed Fizzbuzz.

Here is what my code looks like.. 

for (var i = 1 ; i<= 20; i++){ 

if( i % 3===0 && i % 5===0){
else if (i% 3===0){
else if ( i % 5 === 0 ){

else {

What went wrong here?


I think you (incorrectly) copied the error message by hand instead of using your OS's clipboard feature. I don't think that's the error message you got.

So what does the real error message say that what you wrote here doesn't?


It really says "Oops, try again. You printed Fizzbuzz when you should have printed FizzBuzz."


And are those the same?


They are not. And I will never be the same again either...:pensive:


Forever onwards looking for those little details I hope :P


Thank you very much!


Hey dude, I had the same problem with the same error message for a while until i finally figured it out. Your code looks identical to mine, except for the first line. Here is mine: for(i = 1; i < 21; i++) Hope that helps! I would try to explain it, but I'm not really sure why yours doesn't work. Its syntax looks fine.


I think the problem comes from for (var i = 1 ; i<= 20; i++) . You shouldn't put "var". At least for me this is the way it works: for ( i = 1; i <= 20; i++) {...

You must have mixed the format of the for loop and the for/in loop...

Yet I'm not an expert, I might also be mistaken.


Replace Fizzbuss to FizzBuzz


I kept it to "i<21" and it worked for me


YUP this code is fine is the spelling in your console.log lol just a typo


for( var i=1; i<21; i++ ) {

if ( i%3 ===0 && i%5 ===0 ) {
else if (i%3===0){
else if (i%5===0){


at last that semicolon i think so..