Created
September 22, 2015 00:15
-
-
Save coreyc/41c09c96b904282c86e4 to your computer and use it in GitHub Desktop.
check if string is typeof or instanceof
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isString(str) { | |
return typeof(str) === 'string' || str instanceof String; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment