You can use Array.prototype.includes, which checks if the array includes the value. Note that this is not supported on Internet Explorer, you can find the polyfill at the mentioned link. Per the documentation:

Array.prototype.includes

The includes() method determines whether an array includes a certain element, returning true or false as appropriate.