Home Reference Source Repository

js/etc/ArrayFrom.js

if(!Array.from) {
  Array.from = function(iterable) {
    if (!iterable) return [];
    if ('toArray' in Object(iterable)) return iterable.toArray();
    var length = iterable.length || 0, results = new Array(length);
    while (length--) results[length] = iterable[length];
    return results;
  }
}