JavasScript forEach using Array initialize

# forEach loop using array

// All borwser support
ㅇ Array.apply(null, Array(10))
Array.apply(null, Array(6)).forEach((_,i) => { console.log(i) });

ㅇ using string
new Array(10).join().split(“,”).forEach((_,i) => { console.log(i) });
new Array(10).toString().split(“,”).forEach((_,i) => { console.log(i) });

// Not working on IE
ㅇ fill method
Array(length).fill(default value);
Array(4).fill(1);
// https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/fill

# initialize javascript array with initial value
var a = Array.apply(null, Array(24)).map(function() { return 0 });
var a = function _re(n){if(n > 0) return _re(n-1).concat(n); return [0];}(10);