...

/

Tip 6: Check Existence in an Array with Includes()

Tip 6: Check Existence in an Array with Includes()

In this tip, you’ll learn how to find out if a value exists in an array without checking position.

We'll cover the following...

It’s easy to get so caught up in the big exciting changes in a language (such as the spread operator, which you’ll see in a moment) that you miss the small changes that simplify common tasks.

Testing existence

Arrays now have an easy improvement to handle a common problem: testing existence. Testing existence is an important action, and it’s crucial in everything from ternaries ( ...

Access this course and 1400+ top-rated courses and projects.