Consider using function to check type of variable

I think we should use function to check type of variable like underscore or lodash do to make it more flexible or easier to test