vuejs/vue-hackernews-2.0

what is the purposes of using filter(_ => _)?

gknpezgssb opened this issue · 1 comments

in src/entry-clint.js line 47

...
const asyncDataHooks = activated.map(c => c.asyncData).filter(_ => _)
...

in src/store/getters.js line 20

...
activeItems (state, getters) {
    return getters.activeIds.map(id => state.items[id]).filter(_ => _)
  }
...

what is the purposes of using filter(_ => _)?
just get a new array?

it filters out "empty" items (anything that's falsy).