'I need to make an array that makes a staircase with numerals, before the numeral there has to be a space, in the first "step" there are the same number of spaces as steps - 1, in the second - 2, and so, What I need is to concatenate the two repeaters, I leave what I have written so far.
function escalera(numero){
var escalera = [];
for(var i= 1; i <= numero; i++){
for(var a =1; a < numero; a++){
var escalon = " ".repeat(numero-a) + "#".repeat(i);
}
escalera.push(escalon);
}
return(escalera)
}
This should be seen:
escalera(5) = [
" #",
" ##",
" ###",
" ####",
"#####"
]