News for hackers. Stuff that matters.
Re:Hegel – An advanced static type checker for JavaScript by lshevtsov on Thursday October 27, 2022 @09:18AM (#33357037)
It's because it is not proven that element with the index 1 exists. Even TypeScript enforces bounds checking these days.

As for the first one - as i understand, this will spoil the original array, as it is assigned by reference; so by writing the string into `numbersOrStrings`, you also write it into `numbers`, thus violating the type.

There are no comments on this comment yet.