javascript check if item exists in array of objects