📜  js 检查数组 - Javascript 代码示例

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

代码示例6
// I know javascript can be hard but see this example and you will learn

// Javascript if condition and array example
var people = ["filex", "alex", "jon"];
var peopleNeeded = people[1]; // 1 is the index bc the index starts from 0
 
if (peopleNeeded <= people[1]) {
 console.log("alex needed");   
} else {
 console.log("lol");   
}