![](https://leminal.space/pictrs/image/82ec3372-5a07-4eef-921f-5b25170a7bf0.webp)
![](https://lemmy.ml/pictrs/image/c0ed0a36-2496-4b4d-ac77-7d2fd7f2b5b7.png)
There are some cases where any
must be used instead of unknown
but they usually involve generic constraints and seem more like a bug than intended behavior
There are some cases where any
must be used instead of unknown
but they usually involve generic constraints and seem more like a bug than intended behavior
No no, 10 base 512 lines of code
They can connect via USB so you can do things like perform a clean shutdown when it loses power
It makes sense if you just think of everything as a function.
JSX can exist without React; it’s essentially just an alternative syntax for function calls.
(That is, annoyingly, handicapped in the Typescript checker)
This happens all the time. I feel like a big reason people don’t like meetings is that they tend to involve a lot of bikeshedding.
Finger. Exercise.
Computers are binary, yeah? So we have to represent fractional numbers with binary, too.
In decimal, numbers past the decimal point are 10^-1, 10^-2, … etc. In binary, they’re 2^-1, 2^-2, …
2^-1 is one half, so 0.1 in binary is 0.5 in decimal. 2^-2 is one quarter. 0.11 in binary is 0.75 in decimal. And of course you’ve got 0.01 = 0.25
The problem comes when representing decimal numbers that don’t have neat binary representations. For instance, 0.1 in decimal is actually a repeating binary number: 0.0001100110011…
Fun fact: NaN
is of type number
But generic type syntax is a feature exclusive to Typescript while
typeof
is a JavaScript thing. You’d never getPie[Pie[T]]
as a result from atypeof
check. (Please excuse the square brackets; seems like the markdown parser here isn’t quite right and it keeps messing up the angle brackets)Also, it’s
typeof foo
nottypeof(foo)
in js