js-exercises/repetidorLetras/12.js

13 lines
248 B
JavaScript

function main() {
var palabra = document.getElementById('numeroDeLetras').value;
for (let a = 0; a < palabra.length; a++) {
for (let i = 0; i <= a; i++) {
document.writeln(`${palabra[i]}`);
}
document.writeln(`<br>`)
}
}