robb / Underscore.m

A DSL for Data Manipulation

Home Page:https://robb.github.io/Underscore.m/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement drop

robb opened this issue · comments

Underscore.drop(@[ @1, @2, @3 ], 1); // 2, 3

Edit: take totally is head anyways

Can't you do that using filter?

Actually, it's not possible to do that only with filter. You need access to the element's index whereas filter only passes the element to its block.

I totally failed here, take is already implemented by head. That being said, something like underscore.js' initial could by useful:

Underscore.initial(@[ @1, @2, @3 ], 1); // 1, 2

essentially a dropRight