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: 
`indexOf()` and `includes()` can both be used to find elements in an array, however each function yields different return values.

`indexOf` returns a number (`-1` if element not present in the array, or array position if the element is present).

`includes()` returns a boolean value (`true` or `false`).
The answers and examples were all great. However (at first glance), it made me misunderstood that `includes` will always return `true` when using `undefined`.

Hence I am including the example to elaborate **includes can be used to check for undefined and NaN values** wherelse **indexOf can't**

```js
//Array without undefined values and without NaN values. 
//includes will return false because there are no NaN and undefined values

const myarray = [1,2,3,4]

console.log(myarray.includes(undefined)) //returns false
console.log(myarray.includes(NaN)) //returns false

//Array with undefined values and Nan values.
//includes will find them and return true

const myarray2 = [1,NaN, ,4]

console.log(myarray2.includes(undefined)) //returns true
console.log(myarray2.includes(NaN)) //returns true

console.log(myarray2.indexOf(undefined) > -1) //returns false
console.log(myarray2.indexOf(NaN) > -1) //returns false
```

Summary

* `includes` **can** be used to check for undefined and NaN values in array
* `indexOf` **cannot** be used to check for undefined and NaN values in array