I\'ve looked a fair bit, so pardon me if this has already been answered.
I\'m also curious as to what the actual term is called; Is it \"Ambiguous\" for the type of argu
A completely undeclared variable can't be passed in JS; you can only pass declared variables or undeclared properties of other variables.
In other words:
var a; // you can do _.defined(a)
var a = undefined; // you can do _.defined(a)
a.b; // you can do _.defined(a.b), even though we never defined b
Basically, so that variables can have default values.
Why don't you just initialize the variable with a default value?
Or, just initialise the variable before calling defined
.
var variable; // Note that this will not overwrite the variable if it is already set.
Or, even better.
var variable = variable || 'default';