Can anyone provide an explanation for this?
Array.from(undefined);
// Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
Array.from(null);
// Uncaught TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
Array.from('Break this up');
// ["B", "r", "e", "a", "k", " ", "t", "h", "i", "s", " ", "u", "p"]
Array.from(123);
// []
Why does the last example result in an empty array? Since 123 is not iterable.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from
Array.from(arrayLike [, mapFn [, thisArg]])
arrayLike An array-like or iterable object to convert to an array.