Unexpected token const (second) - find the id of the object in weather that has a min_temp of 15.915

#1

Hello !

Could somebody help me and tell me what is wrong with this code //find the id of the object in weather that has a min_temp of 15.915

const idealTemp = weather.find(((newItem) => {
  return newItem['min_temp'] === 15.915
})

const perfectTemp = idealTemp.id;

console.log(perfectTemp);

Error :Unexpected token const (second)

Thanks!
Joanna

#2

You have a syntax error. I’m not going to tell you what it is because you need to practice figuring that out for yourself, but I’ll give you some advice on how to figure it out. Don’t use inline arrow functions. Just make a normal function.
Don’t use single quotes.