yyb
10 天以前 5359fd3a4cd761bfec6ea9f92a459a8b88b815f1
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')));
};