Example 1 — Fixed Top E
Outer loop chooses the first letter on the row; inner loop appends forward up to E.
const top = "E".charCodeAt(0);
const base = "A".charCodeAt(0);
for (let i = top; i >= base; i--) {
let line = "";
for (let j = i; j <= top; j++) {
line += String.fromCharCode(j);
}
console.log(line);
} How It Works
1. Outer loop moves the start. i runs from the code of E down to A — one start letter per row.
2. Inner loop appends forward. For each row, j runs from i up to top. When i is C, that builds CDE.
3. Break the line. console.log(line) after the inner loop ends the row.
4. Full last row. When i is A, the inner loop builds the full forward run ABCDE.

