extend("test")
extend("array")
extend("string")
describe("array:each", () => {
it("applies function directly to each element", () => {
array:each(x => x * 2, [1, 2, 3])
})
it("works with partial application", () => {
partial = array:each(x => x * 2)
partial([4, 5, 6])
})
it("works with placeholder for function", () => {
placeholder = array:each(_, ["A", "B", "C"])
placeholder(x => x)
})
it("works with custom lambda function", () => {
double = x => x * 2
array:each(double, [1, 2])
})
})