DEV Community

Discussion on: How do you deal with null vs undefined?

Collapse
 
akashkava profile image
Akash Kava

I use undefined is a abort in binding, for example in Web Atoms framework, we can create binding like

    <div text={Bind.oneWay(()  => this.a ? this.b : this.c )}/>

In above case, this basically refreshes text whenever a b or c is modified, however, I can set any of it to undefined to cancel the update operation. Update will occur only if all are not undefined, this allow me to clearly distinguish between undefined and null.