During a code review, I came across the following code:
var a = { ... }; // an object filled with key-value pairs
for (var key in a) {
if (!angular.isUndefined(key)) {
do.stuff();
}
}
I am questioning whether key
can ever be undefined or evaluate to
true</code according to <code>angular.isUndefined
. It seems unlikely based on my experimentation:
var a = { undefined: 'hello' }
When I tried this, it showed that undefined
is actually recognized as a String
.