undefined vs. null in JavaScript

This is how they deal with assignments:

> function nothing() { return; }

> let x = nothing()
<- undefined

> if (x) { console.log("it doesn't error even on dereference"); }
<- undefined

> if (!x) { console.log("because it's falsey"); }
because it's falsey
<- undefined

That's extremely forgiving...and not the direction we want to go in the "undefined" case.

(Not only does accessing variables holding NOTHING cause errors on access in Ren-C, ultimately we went with NOTHING as being truthy.)

1 Like