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
14
extend("test")
extend("array")

describe("array:pluck", () => {
  it("extracts values by key from MixedArray of keyed objects", () => {
    items = [[name:"A"], [name:"B"], [city:"C"]]
    expect_equal(array:pluck("name", items), ["A","B", _])
  })
  it("partial usage with key first", () => {
    pl = array:pluck("city")
    expect_equal(pl([[city:"X"], [name:"N"]]), ["X", _])
  })
})