It does seem likeanyis highly convenient when working with TypeScript, which is true; however, the issue is: what do we use TypeScript for then? You see, it’s easy to try to avoid complex types when there’s the option to useany, but that should be the exception rather than the r...
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...
>>about JavaScript? >What significant bugs does JScript have? OK, there are some well- >known bugs with elisions, toFixed, etc. but there's nothing too >major as far as I know. > Not necessarily bugs, but a few inconsistencies in how the DOM is handled and how...
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...