File size: 242 Bytes
bc20498 |
1 2 3 4 5 6 7 8 |
export var slice = Array.prototype.slice;
export default function(x) {
return typeof x === "object" && "length" in x
? x // Array, TypedArray, NodeList, array-like
: Array.from(x); // Map, Set, iterable, string, or anything else
}
|