↓ Skip to main content

“I think this is some kind of false security because you expect things to just work.”

Tim Raderschadcstrnt.dev ↗

A const array passed to a function still gets sorted in place, and TypeScript says nothing. An array typed any compiles fine and crashes at runtime. The fixes are readonly and unknown, two keywords most codebases never use. TypeScript only protects you as much as you tell it to, and the defaults tell it very little.