Comment

Comment by TrianguloY

Can't wait to see all the errors and questions when users start using this for the missing switch statement, and not realizing it doesn't work for non-dotted constants.

Because if I didn't misunderstood, this is not correct, is it?

  NOT_FOUND = 404
  OK = 200

  match getCode():
      case NOT_FOUND:
          return default()
      case OK:
          return response()
parent TrianguloY 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton