If I have a list in Python, I can check if the given value is in it using the in
operator:
>>> my_list = ['a', 'b', 'c'] >>> 'a' in my_list True >>> 'd' in my_list False
If I have an array in JavaScript like
var my_array = ['a', 'b', 'c'];
Can I check if the value in it is similar to the Pythons in
operator, or do I need to loop through an array?
source share