// 5番目の要素から最後まで取り出す
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(arr.fill(100)) // [100,100,100,100,100,100,100,100,100,100]

// 2番目の要素から5番目の要素まで取り出す
const arr2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(arr2.fill(100,3)) // [1,2,3,100,100,100,100,100,100,100]

// 1番目の要素から2番目の要素まで取り出す
const arr3 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(arr3.fill(100, 1, 3)) // [1,100,100,4,5,6,7,8,9,10]

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.