Just got caught by this type cast semantic... > /[A-Za-z]/.test(undefined) === true Because it's essentially: > /[A-Za-z]/.test('undefined') === true Oh JavaScript.
-
Show this thread
-
Replying to @sebmck
This is a great reason to use a type-checked version of JS (Flow or TypeScript): it renders an entire class of errors like this impossible.pic.twitter.com/EUL9GTbeLZ
1 reply 0 retweets 9 likes
Replying to @RoystonShuff
See my follow up tweet with more context. TypeScript and Flow don’t require bounds checks for indexes.
6:27 AM - 4 Feb 2019
0 replies
0 retweets
7 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 