Skip to content

annalyns-infiltration #188

@A-Young-Git

Description

@A-Young-Git

Instead of returning boolean literals after a condition, you can directly return the condition instead.

Example:

// instead of
if (knightIsAwake) {
return true;
} else {
return false;
}

// ... return the expression directly
return knightIsAwake;

THIS IS INCORRECT. If knightIsAwake = true, then we cannot do a fast attack (false)
If you were to return the direct condition, it will fail.

if knightIsAwake then we return true which is false
if !knightIsAwake then we return false which should be true that we CAN do a fast attack

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