3 ms·
> Think the ternary operator, but worse. How the hell is it worse? It lets me write things like toolbar.visibility = userSettings.showToolbar ?? defaultSe
by Razengan 7y ago
> Think the ternary operator, but worse.
How the hell is it worse? It lets me write things like
toolbar.visibility = userSettings.showToolbar ?? defaultSettings.showToolbar
someOption = localPreference ?? onlinePreference ?? defaultPreference
which is a lot better for the coder and a reader than any other alternative I can currently think of.
- Razengan 7y agoThink I like others may have read that wrong and it was meant as a joke.