You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2023. It is now read-only.
the more i work with code that has to differentiate between falsey and nullishness, the more i remain convinced its more maintainable to test for nullishness with with an explicit function-call. mixing and matching || and ?? will inevitably lead to spaghetti-code (plus how do you use it in the && case?).
/* * how would ?? help in this use-case? */if(paramDef.valueEncoded===undefined&&local.isNullOrUndefined(paramDef['x-example'])){paramDef.valueEncoded=local.dbFieldRandomCreate({modeNotRandom: true,propDef: paramDef});}
The text was updated successfully, but these errors were encountered:
It wouldn't; (without conditional assignment, which isn't part of this proposal) - this use case isn't covered by this proposal nor is it intended to be.
This proposal is particularly useful when looking up values in a chain with maybe-nullish intermediate values; it's not useful for mutating a maybe-nullish value.
the more i work with code that has to differentiate between falsey and nullishness, the more i remain convinced its more maintainable to test for nullishness with with an explicit function-call. mixing and matching || and ?? will inevitably lead to spaghetti-code (plus how do you use it in the && case?).
real-world use-case with isNullOrUndefined here:
https://github.com/kaizhu256/node-swgg/blob/2017.10.17/lib.swgg.js#L3647
The text was updated successfully, but these errors were encountered: