null is not a very good default value in most cases though, since the operations you do with values of "real" types will not work on null. Therefore actually using your "default" value is pretty much guaranteed to be a bug, identical to using an uninitialized variable.
It would be better to just error out and not allow the uninitialized usage at all, but unfortunately that's not possible in Javascript.
It would be better to just error out and not allow the uninitialized usage at all, but unfortunately that's not possible in Javascript.