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