How does the exhaustiveness check work? For every case, TypeScript infers the type of value: function toGerman2b(value: NoYes) { switch (value) { case NoYes.No: const x: NoYes.No = value; return 'Nein'; case NoYes.Yes: const y: NoYes.Yes = value; return 'Ja'; default: const z...
JavaScript sucks. Everybody knows that. Even me. Google ‘JavaScript sucks’ and see if you also get 12 million hits.But then I am not a programmer (etc). Not only does JavaScript access the GPU, and do whatever when you press enter, it also has access to the DOM. TL;DR: OMG, ...
For example, we cannot use method invocations to specify member values: enum NoYesStr { No = 'No', // @ts-expect-error: Computed values are not permitted in // an enum with string valued members. Yes = ['Y', 'e', 's'].join(''), } TypeScript does not do exhaustiveness checks...