here is a screenshot of the code I wrote
I tried to make the FizzBuzz exercise, but every number I fill in it says ‘Not a Number’
does anyone know how I can fix this?
many thanks,
caesar
here is a screenshot of the code I wrote
I tried to make the FizzBuzz exercise, but every number I fill in it says ‘Not a Number’
does anyone know how I can fix this?
many thanks,
caesar
You put semi colon after each if
so it is an empty statement. The next line is return "Not A Number"
which will happen every time. Hence the code under being vanished because it detected dead code. It will never get there.
Another hint is that the return
statements are not indented from if
statements while they should.
You seem to be using VS Code.
Use ⇧+Alt+F to format your document.
Remove a semi-colon after an if
statement and try again.
Repeat.