3 ms·
Of course undefined is safe. It is just a different kind of null, and nothing else.
by paavohtl 5y ago
Of course undefined is safe. It is just a different kind of null, and nothing else.
- otabdeveloper4 5y agoYou're redefining "safe" to mean "doesn't segfault". Telling your boss that the frontend is splattered with 'undefined' and all the balances are unsynchronized, but, hey, it's not a bug because no segfaults were involved in the process is a very good way to get fired.
- paavohtl 5y agoIf you are using TypeScript (which you should), undefined is not inherently any more dangerous or unpredictable than any other form of encoding missing values.
- otabdeveloper4 5y agoTypeScript is better than JavaScript, yes. But still it doesn't guarantee anything at runtime.
- kaba0 5y agoCan you modify a value in another part of your code through undefined?