I'm making a todo list and I don't really understand this whole complete check function, like where does the item come from and so...can anybody help me to explain! Thank you so much for helping me!
This is the function:
const handleComplete = (todo) => {
setTodos(
todos.map((item) => {
if(item.id === todo.id){
return {...item, completed: !item.completed}
}
return item
})
)
}