Skip to content

Instantly share code, notes, and snippets.

@coreyc
Created September 22, 2015 00:15
Show Gist options
  • Select an option

  • Save coreyc/41c09c96b904282c86e4 to your computer and use it in GitHub Desktop.

Select an option

Save coreyc/41c09c96b904282c86e4 to your computer and use it in GitHub Desktop.

Revisions

  1. coreyc created this gist Sep 22, 2015.
    3 changes: 3 additions & 0 deletions instanceof-vs-typeof.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    function isString(str) {
    return typeof(str) === 'string' || str instanceof String;
    }