News for hackers. Stuff that matters.
Re:JavaScript Pattern Matching Proposal by timhwang21 on Wednesday April 25, 2018 @01:36PM (#16923969)
I wouldn't necessarily say it's deep equality, it's just a less verbose way of sequentially checking properties. It's not going to check every property.

At least for me, I feel I'd be using this a lot for the boring but common use case of checking for empty arrays and such:

  const doSomethingToArr = arr => match (arr) {
    [] => whatever,
    [x] => whatever,
    [x, ...xs] => whatever
  }

There are no comments on this comment yet.