Using typeof keyword instead of function