3 ms·
Lack of the safe navigation operator is a real PITA. You can replace "??" with "||" (more or less), but no solution exists for "?." and I don't know how I lived
by patates 8y ago
Lack of the safe navigation operator is a real PITA. You can replace "??" with "||" (more or less), but no solution exists for "?." and I don't know how I lived without it before.
- vimslayer 8y agoLuckily, we'll probably get it sooner or later [1]. There are also a bunch of typesafe getter function utility libraries that are better than nothing [2-3]. [1] https://github.com/tc39/proposal-optional-chaining https://github.com/tc39/proposal-optional-chaining [2] https://github.com/pimterry/typesafe-get https://github.com/pimterry/typesafe-get [3] https://github.com/yayoc/optional-chain https://github.com/yayoc/optional-chain