change array range value javascript

JavaScript
arr.fill(value[, start[, end]])

Source

Also in JavaScript: