Cuéntanos qué está pasando:
It’s asking me to create a function called “pirámide,” but the validator doesn’t accept quotation marks because it’s programmed in English. So I typed the word “pyramid” to try and get it to work, but it’s not working. It keeps asking me to type “pirámide” exactly, but it’s not working.
Tu código hasta el momento
function pyramid(char, rows, bool) {
let result = "\n";
const rows = [];
for (let i = 1; i <= rows; i++) {
const spaces = " ".repeat(rows - 1);
const content = char.repeat(2 * i -1);
rows.push(spaces + content);
}
if(bool) {
rows.reverse();
}
result += rows.join("\n") + "\n";
return result;
}
console.log(pyramid("*", 3, false));
console.log(pyramid("#", 3, true));
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Información del Desafío:
Construir un Generador de Pirámides. - Generar un pirámide