📌  相关文章
📜  如何在javascript代码示例中检查数组是否包含数字

📅  最后修改于: 2022-03-11 15:03:16.033000             🧑  作者: Mango

代码示例2
// To check if an array contains a number
const ratings = [1,2,3,4,5];

let result = ratings.includes(4); 
console.log(result); // true

result = ratings.includes(6); 
console.log(result); // false