changed the current to use "typeof"

this helps with cross-browser comparison of `undefined` data type.