Question: Beyond the improved readability, is there any advantage to `includes` over `indexOf`? They seem identical to me.

What is the difference between this

```
var x = [1,2,3].indexOf(1) > -1; //true

```

And this? 

```
var y = [1,2,3].includes(1); //true

```

Answer: 
Internet explorer does not support includes, if that helps you decide.

<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Browser_compatibility>
The includes() method is slightly different than the indexOf()
method in one important way. indexOf() tests equality using the
same algorithm that the `===` operator does, and that equality algorithm
considers the not-a-number value to be different from every other
value, including itself. includes() uses a slightly different version
of equality that does consider NaN to be equal to itself. This means that
indexOf() will not detect the NaN value in an array, but
includes() will:

```
let a = [1,true,3,NaN];
a.includes(NaN) // => true
a.indexOf(NaN) // => -1; indexOf can't find NaN

```

From [JavaScript: The Definitive Guide by David Flanagan](https://%20https://www.amazon.com/JavaScript-Definitive-Guide-Activate-Guides/dp/0596805527)