Commit df820b52 authored by oak-tree's avatar oak-tree Committed by Sindre Sorhus

Close GH-974: no using underscore -> no last() on collection..

parent e3d28cb2
...@@ -26,6 +26,11 @@ var app = app || {}; ...@@ -26,6 +26,11 @@ var app = app || {};
return this.where({completed: false}); return this.where({completed: false});
}, },
// Return last item on list if any. Otherwise return null.
last: function () {
return this.length > 0 ? this.at(this.length - 1) : null;
},
// We keep the Todos in sequential order, despite being saved by unordered // We keep the Todos in sequential order, despite being saved by unordered
// GUID in the database. This generates the next order number for new items. // GUID in the database. This generates the next order number for new items.
nextOrder: function () { nextOrder: function () {
......
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