问答详情
源自:3-4 实现todo应用的业务逻辑

this.todos.filter(todo => completed === todo.completed)

this.todos.filter(todo => completed === todo.completed)

这里的todo 是什么呀。求指点

提问者:雨道3436185 2021-05-24 10:47

个回答

  • 任性的学渣
    2021-06-09 15:57:10
    已采纳

    如果你换成ES5就知道了

    this.todos.filter(function(todos) {

        return completed === todos.completed

    }

  • 任性的学渣
    2021-06-09 15:59:23

    如果你换成ES5就知道了

    this.todos.filter(function(todo) {

        return completed === todo.completed

    }


  • 雨道3436185
    2021-05-24 10:49:08

    我换成 

    this.todos.filter(todos => completed === todos.completed)

    也一样啊

    所以这个todo是哪来的