input.js 187 B

12345678
  1. // Array destructing
  2. const result = [0] |> (([x]) => x);
  3. expect(result).toBe(0);
  4. // Object destructuring
  5. const result2 = { y: 1, z: 2 } |> (({ y, z }) => y + z);
  6. expect(result).toBe(3);