sample_fill() { const a = new Array(5); a.fill(8); prn(a); //[ 8, 8, 8, 8, 8 ] }
sample_fillSequence() { const a = new Array(5); a.fill(0); //Use optional param "index" const sequence = a.map((each, index) => index + 1); prn(sequence); //[ 1, 2, 3, 4, 5 ] }