javascript check if value exists in nested array of objects