Commit 782fdad4 authored by Sindre Sorhus's avatar Sindre Sorhus

Merge pull request #934 from pgilad/patch-1

reduce redundant filter & without syntax
parents 4acb4d47 c81b9d1a
...@@ -16,14 +16,12 @@ define([ ...@@ -16,14 +16,12 @@ define([
// Filter down the list of all todo items that are finished. // Filter down the list of all todo items that are finished.
completed: function () { completed: function () {
return this.filter(function (todo) { return this.where({completed:true});
return todo.get('completed');
});
}, },
// Filter down the list to only todo items that are still not finished. // Filter down the list to only todo items that are still not finished.
remaining: function () { remaining: function () {
return this.without.apply(this, this.completed()); return this.where({completed:false});
}, },
// We keep the Todos in sequential order, despite being saved by unordered // We keep the Todos in sequential order, despite being saved by unordered
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment