In javascript, undefined goes past a script in which a value has not been set. For example, if you are looking for a property on a model that does not exist, it will give undefined.
Not so strange to have code like this:
var k;
// do something (maybe by setting k)
alerts (k);
If the value has not been set, it will be undefined, not null.
In short, this is still a preference, but using undefined, you will most likely catch cases where the values ββwere not initialized or did not try to access the properties of objects that do not exist.
Not sure if this answers your question.
source share