Skip to content

Conversation

deepsource-dev-autofix[bot]
Copy link

Yoda conditions are named so because the literal value of the condition comes first while the variable comes second.

For instance,

if ("red" === color) {
    // ...
}

Yoda condition is fixed by switching the literal and variable.

Yoda conditions are named so because the literal value of the condition comes first while the variable comes second.

For instance,

```js
if ("red" === color) {
    // ...
}
```

Yoda condition is fixed by switching the literal and variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants