Js method determines whether the array contains the specified value

var array = new Array();
array = [1,2,3,4];
var x = 2;
console.log(array.includes(x));

Guess you like

Origin www.cnblogs.com/qiaochaoyu/p/11718471.html