TypeScript: type for map

By Xah Lee. Date: .

some random notes of TypeScript complexity

Cannot infer the type for JavaScript map

TypeScript cannot infer the type for js map. odd.

TypeScript map 2026-09-21 271d7 ll
TypeScript map 2026-09-21 271d7 ll
TypeScript map errors 2026-09-21 34a4a ll
TypeScript map errors 2026-09-21 34a4a ll

Typescript non-null assertion

TypeScript non-null assertion 2026-09-21 33dbe ll
TypeScript non-null assertion 2026-09-21 33dbe ll
work in progress

Typescript generics

i think generic is a very annoying thing.

havent dived into details yet, but i think they are object oriented language thing. not a general thing. unnecessary in functional programing languages.

TypeScript generics 2026-09-21 3426a ll
TypeScript generics 2026-09-21 3426a ll
generics polymorphism 2026-09-27 18910 ll
generics polymorphism 2026-09-27 18910 ll

perfect JavaScript code, lots errors in TypeScript.

TypeScript xmas tree 2026-09-21 33e16 ll
TypeScript xmas tree 2026-09-21 33e16 ll