Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Convert x === y condition to [y].includes(x) #41

Open
KristjanTammekivi opened this issue Dec 26, 2021 · 0 comments
Open

Comments

@KristjanTammekivi
Copy link

I noticed today that quite often I have something like

if (someVar === 'value1') {

}

and then I need to add another possible value so I either need to do || someVar === 'value2' or more concisely if (['value1', 'value2'].includes(someVar))

So would be nice if there was a refactoring to convert === to Array includes call (and bonus if I already have an OR statement and I could convert both of them to one includes call

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

No branches or pull requests

1 participant