I'm currently following along CS50 Harvard's Beyond React Course and I'm currently practicing making a Todo List and Deleting a Task by clicking on a button. One thing I don't understand is how for deleting a task, we don't want to immediately call deleteTask(i) on the click of a button because as the lecturer quotes, "That is the result of a function, and that is not what we want to do." Instead he wraps the deleteTask function in another function with no arguments, and I don't understand the difference between my version and his version, and what he means by result. 

This is the deleteTask

```
deleteTask = (index) => {
        this.setState(state => {

          const tasks = [...state.tasks];
          tasks.splice(index, 1);
          return {
            tasks: tasks
            };
          })
      }

```

This is what was recommended within the onClickButton:

```
               <ul>
                {this.state.tasks.map((task, i) => 
                    <li key={i}>
                      {task}
                      <button onClick={() => this.deleteTask(i)}>Delete</button>
                    </li>
                  )}
              </ul>

```

But this is what I had:

```
               <ul>
                {this.state.tasks.map((task, i) => 
                    <li key={i}>
                      {task}
                      <button onClick={this.deleteTask(i)}>Delete</button>
                    </li>
                  )}
              </ul>

```