注意:对象数组不能使用includes方法来检测。 JavaScript Demo: Array.includes() var array1 = [1, 2, 3]; console.log(array1.includes(2)); // expected output: true var pets = ['cat', 'dog', 'bat']; console.log(pets.includes('cat')); // expected output: true console.log(pets.includes('at')); // expected output: false
转载于:https://www.cnblogs.com/52wxb1314/p/11065394.html