yyb
4 天以前 4a12e133d6957f4d2f108901aeea0e988f6c52f8
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')));
};