TypeScript Stories
60 subscribers
40 links
Download Telegram
2️⃣1️⃣
🤔 Types 'asd' | string and 123 & number.

▶️ Playground
2️⃣2️⃣
Null-porotype object still has prototype types.

▶️ Playground
2️⃣3️⃣
Wrong behavior with array type intersections.

▶️ Playground
2️⃣4️⃣
Strange behavior with union of arrays.

▶️ Playground
2️⃣5️⃣
Weirdness with void type.

▶️ Playground
2️⃣6️⃣
Weirdness of Record type.

▶️ Playground
2️⃣7️⃣
No error when no overlapping with null or undefined?

▶️ Playground
2️⃣8️⃣
No error when destructuring non-existent element with default value?

▶️ Playground
2️⃣9️⃣
🤔 Destructuring from never[] is of type undefined.

▶️ Playground
3️⃣0️⃣
Assign non-nullable type {} to non-primitive object.

▶️ Playground
3️⃣1️⃣
Incrementing literal type in for loop.

▶️ Playground
3️⃣2️⃣
Wrong type inference with Capitalize and Uncapitalize utility types.

▶️ Playground
3️⃣3️⃣
Something wrong with type inference or Promise.then typings.

▶️ Playground
Solution
3️⃣4️⃣
Weird incorrect autocompletion.

▶️ Playground
3️⃣5️⃣
Partial type spreading error.

▶️ Playground
Solution
3️⃣6️⃣
Wrong type inference for number comparing to literals.

▶️ Playground
3️⃣7️⃣
Wrong union assignment.

▶️ Playground
3️⃣8️⃣
Type guard narrowing type loss after reassignment.

▶️ Playground
3️⃣9️⃣
Dangerous usage of spread operator.

▶️ Playground
4️⃣0️⃣
Incorrect type narrowing for
let value: <union type> = ...


▶️ Playground
▶️ More real-world example and solution