+ 1
Plz explain js code
var arr=[9,8,7,6]; console.log(1 in arr) //true console.log(9 in arr) //false Why 1 in arr is true
1 Odpowiedź
+ 7
7n4n03n , with "in" you are checking for element in the array if it's present in certain position. So there is an element on position 1, but there's no element on position 9 (the last position of the array is 3).