How to use in operator to check if exist in array in JavaScript

1 Answer

0 votes
let arr = ['javascript', 'c++', 'c', 'python']

console.log(0 in arr);
console.log(3 in arr);
console.log(5 in arr);



/*
run:

true
true
false

*/

 



answered Nov 19, 2020 by avibootz
...