DEV Community

Ayesha Ali
Ayesha Ali

Posted on

⚡Use of 'include' Method in JavaScript

Hey guys, Hope you are all well.
Let's discuss 'include' method in JavaScript .It has many uses we talk about one of them here.

▶ Use 'include' method for multiple Criteria.

If you have to check a lot of conditions in your "if" then instead of extending the statement with more " || " or operator, Write your condition by using Array. include.

Image description
Shorter and more declarative !

Top comments (0)