exec.js 279 B

123456789101112131415
  1. var result = [5,10]
  2. |> (_ => _.map(x => x * 2))
  3. |> (_ => _.reduce( (a,b) => a + b ))
  4. |> (sum => sum + 1)
  5. expect(result).toBe(31);
  6. var inc = (x) => x + 1;
  7. var double = (x) => x * 2;
  8. var result2 = [4, 9].map( x => x |> inc |> double )
  9. expect(result2).toEqual([10, 20]);