javascript check if object exists in array