Skip to content

Commit

Permalink
DRYer .take() method
Browse files Browse the repository at this point in the history
  • Loading branch information
busticated committed Apr 7, 2013
1 parent fe161c1 commit cc3943a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/iterator.js
Expand Up @@ -316,11 +316,13 @@ define(function(){
return out;
},
take : function( count ){
var items = this.collection.slice( 0, count );

if ( this.key ){
return new It( this.collection.slice( 0, count ), { useLookupKey: this.key } );
return new It( items, { useLookupKey: this.key } );
}

return new It( this.collection.slice( 0, count ) );
return new It( items );
}
};

Expand Down

0 comments on commit cc3943a

Please sign in to comment.