array fill

JavaScript
    var numeroPerguntas = 5;     
    var anyBoxesChecked = new Array(numeroPerguntas).fill(false);
    console.log(anyBoxesChecked);let filledArray = new Array(10).fill({'hello':'goodbye'});new Array(5).fill('element')
// ["element", "element", "element", "element", "element"]const fill = new Array(5).fill(0)
console.log(fill) // [ 0,0,0,0,0]Array(24).fill(0)

Source

Also in JavaScript: