Yonaba / Moses

Utility library for functional programming in Lua

Home Page:http://yonaba.github.io/Moses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Last is different to Rest

ophentis opened this issue · comments

We found last recently changed, and it is not aliased to rest. Which version of underscore are you mapping it to? From what I see, Last by counting last n entries and rest is the starting index, so they are different.

By the way, we have been using your script to work in our project, thanks for the effort.

Thanks for your interest in Moses, and glad it serves you well.
Actually, last and rest are different indeed. last is supposed to returned the last n values from an array, while rest will return all the values after a specific index in the array.

For reference, take a look at how Underscore.js defines last and rest.

I think I mistakenly treat last as tail. Nothing wrong here, closing it.