yyb
7 天以前 2a8cdfd4f464d737dda6e0a9bb43c83109d926a3
1
2
3
4
5
6
7
8
9
export default function isArrayish(obj) {
    if (!obj || typeof obj === 'string') {
        return false;
    }
 
    return obj instanceof Array || Array.isArray(obj) ||
        (obj.length >= 0 && (obj.splice instanceof Function ||
            (Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));
};