FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix Yoda conditions by deepsource-dev-autofix[bot] · Pull Request #256 · anto-deepsource/demo-javascript · GitHub

fix Yoda conditions - #256

Open
deepsource-dev-autofix[bot] wants to merge 1 commit into
masterfrom
deepsource-autofix-8543f31e
Open

deepsource-dev-autofix[bot] wants to merge 1 commit into
masterfrom
deepsource-autofix-8543f31e

Conversation

Copy link
Copy Markdown

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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL