Indexof and Include

IndexOf
indexof which return the index of the that particlar value.
var ar =[12,10,23,22];
var ind = ar.indexOf(12); // if the value is there index value will shows o/p : 0
var ind = ar.indexOf(51); // if the value is not there o/p : -1
console.log(ind)
Includes
Include is not there in ES5 , interduced in ES6. include tells if the value is there it will show true, if not there is shoes false. include won't tell index value
var ar =[12,10,23,22]; var ind = ar.indexOf(12); // if the value is there o/p : true var ind = ar.indexOf(51); // if the value is not there o/p : false console.log(ind)