javascript check if array element exists