📜  if 数组 javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:50.797000             🧑  作者: 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");   
}