ngs
ngs copied to clipboard
Implement limit(Iter, Int)
Could you elaborate more on this?
I am on it
Implement in Iter
.
Should return new object, a subtype of Iter
, probably LimitIter
(a new type), which would give a maximum of n
(the Int
from the constructor) elements.
what is good test case for it? limit([3, 4, 5, 10].Iter(), 2).Arr() == [5, 10] or imit([3, 4, 5, 10].Iter(), 2).Arr() == [3, 4]
what is good test case for it? limit([3, 4, 5, 10].Iter(), 2).Arr() == [5, 10] or imit([3, 4, 5, 10].Iter(), 2).Arr() == [3, 4]
[3, 4]
- must return the elements from the start