Vldln/youtube/01-app/src/App.js
// change completed field in object by setTodos func
change completed field in object by setTodos func
change completed field in object by setTodos func
function toggleTodo(id) {
    setTodos( 
      todos.map((todo) => {
        if (todo.id === id) {
          todo.completed = !todo.completed;
        }
        return todo;
      })
    )
  }
function toggleTodo ( id ) { setTodos ( todos . map ( ( todo ) => { if ( todo . id === id ) { todo . completed = ! todo . completed ; } return todo ; } ) ) }
change completed field in object by setTodos func
change completed field in object by setTodos func