const size = 5;
for (let i = 0; i < size; i++) {
for (let j = 0; j < size; j++) {
const line = i === j;
const head = i < size - j;
print(line || head ? "* " : " ");
}
newline();
}
To enter the code editing mode, press Enter. To exit the edit mode, press Escape
You are editing the code. To exit the edit mode, press Escape