Skip to content
Myr

Added Collection#slice()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 494a067 · Browse files · 2 files+32 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+32 added−4 removed

  • tests:+14 added−0 removed
  • other:+18 added−4 removed

2 files+32 added−4 removed

modified:lib/express/collection.js+18 added-4 removed
modified:spec/spec.collection.js+14 added
87 unmodified lines
88 $({ foo: 'bar' }).first().should.eql 'bar'89 end 90 end91 92 describe '#slice()'93 it 'should return a slice of values'94 var collection = $(['foo', 'bar', 'baz']).slice(1, 3)95 collection.at(0).should.eql 'bar'96 collection.at(1).should.eql 'baz'97 end98 99 it 'should work with objects'100 var collection = $({ foo: 1, bar: 2, baz: 3, raz: 4 }).slice(1, 3)101 collection.at(0).should.eql 2102 collection.at(1).should.eql 3 103 end104 end105 106 end107end