News for hackers. Stuff that matters.
Re:JavaScript Equality Minesweeper by Rumudiez on Monday September 17, 2018 @11:44AM (#18006981)
My team checks for types, not for null.

`const isString = myVar => typeof myVar !== 'string'`

This is more reusable and more idiomatic in my opinion than null/undefined checks

Re:JavaScript Equality Minesweeper by jscissr on Monday September 17, 2018 @02:59PM (#18008909)
But then you have the problem that typeof null === 'object'.
Re:JavaScript Equality Minesweeper by styfle on Monday September 17, 2018 @12:10PM (#18007207)
This is especially useful if you are using TypeScript (or Flow I assume) because the type checker can give you an error at compile time. After performing the runtime check, TypeScript will know that null/undefined is not possible.

See this example https://goo.gl/AyoC3T

Re:JavaScript Equality Minesweeper by hibbelig on Monday September 17, 2018 @03:10PM (#18009001)
Shouldn't that be called `isNotString`?