Skip to content

ELSE can be omitted #388

Description

@StephanWald
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions