var triangle = document.querySelector('.triangle'); // 补全代码 triangle.innerHTML = function () { let num = 1 let content = '' while (num <= 3) { num++ content += new Array(num).join('*')+ '<br/>' } return content }()