If I have a list in Python, I can check whether a 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, e.g.
var my_array = ['a', 'b', 'c'];
Can I check whether a value is in it in a similar way to Python’s in
operator, or do I need to loop through the array?