20 May '13, 7am

@markhneedham Are you familiar with Ruby’s `each_cons` method < It solves your array-slicing problem quite neatly.

Iterates the given block for each array of consecutive <n> elements. If no block is given, returns an enumerator.

Full article: http://apidock.com/ruby/Enumerable/each_cons

Tweets