// 分割第一个参数
var slice = Array.prototype.slice;
var args = slice.call(arguments, 1);
// 是否对象
function isObject(val) {
return Object == val.constructor;
}
// 是否promise
function isPromise(obj) {
return 'function' == typeof obj.then;
}
// 分割第一个参数
var slice = Array.prototype.slice;
var args = slice.call(arguments, 1);
// 是否对象
function isObject(val) {
return Object == val.constructor;
}
// 是否promise
function isPromise(obj) {
return 'function' == typeof obj.then;
}
本文标题:代码
本文链接:https://www.haomeiwen.com/subject/ckpeiftx.html
网友评论