red = -8
if (red < 0) red = 0; else if (red > 255) red = 255
? "The number should be 0: ", red
red = 300
if (red < 0) red = 0; else if (red > 255) red = 255
? "The number should be 255: ", red
When you run it in BBj, the red variable is correctly 0 or 255. However, the VS Code extension reports 4 errors with this program:
This statement needs to start in a new line: else
This statement needs to start in a new line: if (red > 255)
This statement needs to start in a new line: else
This statement needs to start in a new line: if (red > 255)
When you run it in BBj, the red variable is correctly 0 or 255. However, the VS Code extension reports 4 errors with this program: