Skip to content

OR short-circuit evaluation #1900

Closed
Closed
@yardengl

Description

@yardengl

There's a mistake in JavascriptFundamentals/LogicalOperators/OR/Short-circuitEvaluation.
I added the link and a picture of the section with the mistake.

It says:
"In the example below, the first message is printed, while the second is not"

The opposite is true, it even says so later on:
"In the first line, the OR || operator stops the evaluation immediately upon seeing true, so the alert isn’t run."

Also the messages should be switched, instead of:
true || alert("printed");
false || alert("not printed");

should be:
true || alert("not printed");
false || alert("printed");

https://javascript.info/logical-operators

mistake

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions