We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript专题之类型判断(上) JavaScript专题之类型判断(下) 类型判断
// 第二版 var class2type = {}; // 生成class2type映射 "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function(item, index) { class2type["[object " + item + "]"] = item.toLowerCase(); }) function type(obj) { // 一箭双雕 if (obj == null) { return obj + ""; } return typeof obj === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : typeof obj; }
The text was updated successfully, but these errors were encountered:
JavaScript专题之判断两个对象相等
Sorry, something went wrong.
No branches or pull requests
JavaScript专题之类型判断(上)
JavaScript专题之类型判断(下)
类型判断
The text was updated successfully, but these errors were encountered: