js-exercises/banderaAsteriscos/11.js

15 lines
304 B
JavaScript
Raw Normal View History

2024-01-18 12:22:02 +01:00
function main() {
var numAst = document.getElementById('numeroDeAsteriscos').value;
for (let a = 1; a < numAst; a++) {
for (let i = 0; i < a; i++) {
document.writeln(`*`);
2024-01-18 12:22:02 +01:00
}
document.writeln(`<br>`)
}
for (let i = 0; i < numAst / 2; i++) {
document.writeln(`*<br>`)
}
}