Comment

Comment by thalesmello

> You'll have to show me one inventive and useful "ninja" trick revolving around the use of '=='

Sure! For starters, you can write

    if (foo == null) { ... }
Because `undefined` gets coerced to `null`, it saves you from writing:

    if (foo === null || foo === undefined) { ... }
And, because it's shorter, it's even allowed by [some JS linters](https://standardjs.com/).

There you have your JS ninja trick to handle two distinct null types^TM .

parent thalesmello 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton