Skip to content

The equality operator (==) behaves like JavaScript. Should we require a ===? #7

@srbhr

Description

@srbhr

Facing a challenging situation here. There are two statements:

yodaSays = "Named must your fear be, before banish it you can."

myWords = "You must name your fear before banishing it."

yodaSays == myWords  // true

Another such example

yodaSays = "When you look at the dark side, careful you must be. For the dark side looks back."

myHead = "You must be careful when you look at the dark side. For the dark side looks back."

yodaSays == myHead  // true

So, while we're using two different statements, they're equal. While being differently written. So, should there be a === check when talking about checks like this? This might lead to different interpretations in certain cases. 🤔🤔 (Especially comparing between forks.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions