kiinlam
11/14/2016 - 8:35 AM

判断一个对象是否可迭代

判断一个对象是否可迭代

function caniterator (arg) {
    return typeof arg[Symbol.iterator] === 'function';
}