Created
February 27, 2018 10:04
-
-
Save SuperAL/0f0e22f0a0f680a679837dc317d6edba to your computer and use it in GitHub Desktop.
获取值类型
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
| // Reference:https://github.com/jkchao/blog/issues/8 | |
| function getType (val) { | |
| const str = Object.prototype.toString.call(val) | |
| return /^\[object (.*)\]$/.exec(str)[1] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment