News for hackers. Stuff that matters.
Re:Go-like channels in 10 lines of JavaScript by eyelidlessness on Saturday February 04, 2023 @07:29PM (#34660125)
That is (was) a good thing! It’s basically the `as any` of strict null checks, and just as unsafe.

Now that you do know about it, please use it sparingly if at all, i.e. when you’re absolutely sure you know more than the type checker, or when you’re in a context where it’ll be caught by other means. My typical lint setup disallows it in source code without an explanatory comment, and allows it in tests under the assumptions that either they’ll fail if wrong or that a reviewer will call out the test as overly complicated.

There are no comments on this comment yet.