javascript check if exists in array of objects