JavaScript check if array contains a value