DEV Community

Ayesha Ali
Ayesha Ali

Posted on

2

⚡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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay