Does javascripts typeof expression check for null?
var test = {};
console.log(typeof test['test']);//"undefined"
var test = null;
console.log(typeof test['test']);//TypeError: test is null
Obviously, but why the error, if typeof null is an object?
EDIT:
I know how to avoid the type error, and that null has no properties, but I'm wondering is there an explanation to the behavior of typeof.
nullhas no "test" member, attempting to accessing it is illegalnull['test']