Last active
December 25, 2015 03:59
-
-
Save tfanme/6914446 to your computer and use it in GitHub Desktop.
JavaScript:typeof
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
| // sample1:get the type of variables | |
| var str = 'this is a test.'; | |
| alert(typeof str); | |
| // or | |
| // alert(typeof(str)); | |
| // sample2: get the type of literals | |
| alert(typeof 'test!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment