// Sequence generator function (commonly referred to as "range", e.g. Clojure, PHP etc)constrange=(start, stop, step)=>Array.from({length:(stop - start)/ step +1},(_, i)=> start +(i * step));// Generate numbers range 0..4range(0,4,1);// [0, 1, 2, 3, 4]// Generate numbers range 1..10 with step of 2range(1,10,2);// [1, 3, 5, 7, 9]// Generate the alphabet using Array.from making use of it being ordered as a sequencerange('A'.charCodeAt(0),'Z'.charCodeAt(0),1).map(x=>String.fromCharCode(x));// ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
// 'fruits' array created using array literal notation.const fruits =['Apple','Banana'];console.log(fruits.length);// 2// 'fruits2' array created using the Array() constructor.const fruits2 =newArray('Apple','Banana');console.log(fruits2.length);// 2// 'fruits3' array created using String.prototype.split().const fruits3 ='Apple, Banana'.split(', ');console.log(fruits3.length);// 2