Use typeof to cover browsers that can redefine undefined. Relates to #113