array-mumu 0.2.0-rc.5

Array tools plugin for the Mumu ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
extend("test")
extend("array")

describe("array:take_while", () => {
  it("takes while predicate true", () => {
    expect_equal(array:take_while(x => x < 4, [1,2,3,4,1]), [1,2,3])
  })
  it("partial usage", () => {
    tw = array:take_while(x => x % 2 == 0)
    expect_equal(tw([2,4,5,6]), [2,4])
  })
})