Sometimes I want to make a conditional branch based on whether a value is nullish or not.
For now, I am writing as follows, but if there is a clearer way to write (specifically, I don't have to write null twice), please let me know.
if(a??null===null){
// do something
}
What about a==null
?The readability may not be good.
© 2024 OneMinuteCode. All rights reserved.