So I’m trying to check names through an array and I don’t want to have to use
if (<array name>[0,1,2,3,4,5,6,7]) { code in here }
Advertisement
Answer
depend on what you are trying to do u can use forEach or map
let arr = [1,2,3,4,5,6,7,8,9,10]; arr.forEach((item)=>{ console.log(`${item} is greater than 5 : ${item>5}`) })