console.log(Array.from('foo')); // expected output: Array ["f", "o", "o"] console.log(Array.from([1, 2, 3], x => x + x)); // expected output: Array [2, 4, 6] console.log(Array.from({length:10}, (_,key) => key)); // expected output: Array [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
=>
> Array ["f", "o", "o"] > Array [2, 4, 6] > Array [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]