inits package:mono-traversable

Return all the initial segments of seq with the shortest first.
> inits [1,2]
[[],[1],[1,2]]
> inits []
[[]]