enhancement for javascript typeof