Created
July 24, 2019 03:22
-
-
Save JustinSDK/af98791f8863e1b00f9da75e3764cd5c to your computer and use it in GitHub Desktop.
Babel 的 _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 _instanceof(left, right) { | |
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { | |
return !!right[Symbol.hasInstance](left); | |
} else { | |
return left instanceof right; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment