1. 5

A clear, succinct and safe syntax for Pattern Matching using modern JavaScript.

  [2, 4, 1, 2].map(match({
    [when(1)]: 'one',
    [when(2)]: "two",
    [when()]: "many"
  }));

  // [ 'two', 'many', 'one', 'two' ]

  function fact(n){
    return match({
      [when(0)]: 1,
      [when()]: (n) => n * fact(n-1)
    })(n);
  }

  fact(10); // 3628800
  1.