includes
let arr=[1,true,3];
a.includes(1) //=>true;
a.includes(11) //=>false;
indexOfqu
let a=[1,2,3,NaN];
a.includes(1) //=>0
a.indexOf(11) //=>-1
区别
includes认为NaN与自身相等。
let a=[1,2,3,NaN];
a.includes(NaN) //=>true
a.indexOf(NaN) //=>-1