标签: javascript for-loop
我想在JavaScript中使用for循环创建两个金字塔,并在控制台中将其打印出来,如下所示:
答案 0 :(得分:1)
<script type="text/javascript"> var i; for(i=4; i>=1; i= i-1){ var j; for(j=4; j>=i; j = j-1){ var k; document.write(j); } //i want this to print a new line document.write("<br>"); } </script>