Skip to content

Commit af24e20

Browse files
todos contains todo
1 parent c68be4c commit af24e20

File tree

1 file changed

+3
-3
lines changed
  • ep11-switch-to-todo-part2/app/components

1 file changed

+3
-3
lines changed

ep11-switch-to-todo-part2/app/components/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default class App extends React.Component {
99
}
1010

1111
handleDelete (titleToBeDeleted) {
12-
var newTodos = this.state.todos.filter( (_title) => {
13-
return _title != titleToBeDeleted
12+
var newTodos = this.state.todos.filter( (todo) => {
13+
return todo.title != titleToBeDeleted
1414
} )
1515

1616
this.setState({ todos: newTodos});
@@ -42,7 +42,7 @@ export default class App extends React.Component {
4242
Number of total tasks: { this.state.todos.length }
4343
</p>
4444
<p>
45-
Number of total tasks done: { this.state.todos.filter((title) => { title.done }).length }
45+
Number of total tasks done: { this.state.todos.filter((todo) => { todo.done }).length }
4646
</p>
4747

4848
<DisplayList

0 commit comments

Comments
 (0)