1console.log(Array.from('foo'));
2// expected output: Array ["f", "o", "o"]
3
4console.log(Array.from([1, 2, 3], x => x + x));
5// expected output: Array [2, 4, 6]
6
1const set = new Set(['foo', 'bar', 'baz', 'foo']);
2Array.from(set);
3// [ "foo", "bar", "baz" ]
1// Create an array based on a property of DOM Elements
2const images = document.getElementsByTagName('img');
3const sources = Array.from(images, image => image.src);
4const insecureSources = sources.filter(link => link.startsWith('http://'));
5