3 And The Good


#1

for (counter = 1; counter <21; counter++);
{
if (counter%5===0&&counter%3===0)
{
console.log("FizzBuzz")
}
else if (counter%3===0)
{
console.log("Fizz");
}
else if (counter%5===0)
{
console.log("Buzz");
}


else if (counter%3!===0&&counter%5!===0)
{
    console.log(counter)
}

} for (counter = 1; counter <21; counter++);
{
if (counter%5===0&&counter%3===0)
{
console.log("FizzBuzz")
}
else if (counter%3===0)
{
console.log("Fizz");
}
else if (counter%5===0)
{
console.log("Buzz");
}


else if (counter%3!===0&&counter%5!===0)
{
    console.log(counter)
}

}

https://www.codecademy.com/courses/spencer-sandbox/0/3?curriculum_id=506324b3a7dffd00020bf661

Syntax Error: Unexpected token =


Replace this line with your code.


#2

As i can see on my code, everything looks good instad the first line.
It needs to say:

for(var counter [...]

go ahead any try that

plus, it should be with 2 equal sign not 3:


#3

This is not a valid operator, and should raise a console error.

Non-equality is written as, !== (type matching), or != (type converting)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.