I’m trying to make a trunk for this christmas tree. I want to use if so it can be with only one loop as in code. Any ideas how to do it? Thanks.
function Tree() {
const star = "*";
for (let i = 1; i <= 6; i++) {
document.write(`${star.repeat(i)}<br/>`);
}
}
Tree();