Javascript - .includes() and .indexOf()
Code Life
By Pierre Marsaa
Is It in There? includes
To know whether an array contains a value, use includes(). It answers with a boolean: true or false.
↗️
Loading editor...
↶
↷
Since the result is a boolean, it fits directly in a condition:
↗️
Loading editor...
↶
↷
Verify