Is there a limit to how many conditions (e.g., logical OR conditions) that JavaScript allows me to have in an if
statement, or can I have as many as I want?
Asked
Active
Viewed 1,165 times
-2

Cody Gray - on strike
- 239,200
- 50
- 490
- 574

non doe
- 11
- 2
3 Answers
0
You can have as many as you want

mplungjan
- 169,008
- 28
- 173
- 236

Irshad Baiwa
- 11
- 3
-
You can use as many or conditions in an if statement. All will end in a single boolean value. – TarJae Feb 06 '21 at 08:00
0
If
technically have not limits, but If you want a clean code, I recommend you use switch case.
Know more about how to write better conditionals statements here: https://www.digitalocean.com/community/posts/5-tips-to-write-better-conditionals-in-javascript

Pedro Felgueiras
- 121
- 1
- 8
0
There is no limit to use as many as conditions you want , but if we have so many conditions its always good practice to use SWITCH case to make code clean and efficent.

Shivansh Seth
- 311
- 1
- 8