javascript test if array element exists