📌  相关文章
📜  检查数组中的所有值是否为负 javascript 代码示例

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

代码示例1
let numbers = [1, 3, 5];
let result = true;
for (let i = 0; i < numbers.length; i++) {
    if (numbers[i] <= 0) {
        result = false;
        break;
    }
}
console.log(result);Code language: JavaScript (javascript)