Using "typeof" operator to check for functions