📜  如何在javascript代码示例中打印列表

📅  最后修改于: 2022-03-11 15:02:57.882000             🧑  作者: Mango

代码示例1
var array = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
for (var i = 0; i < array.length; i++) {
  var str = '';
  for (var j = 0; j <= i; j++) {
    if (array[j] == 'E') str += '3';
    else str += array[j];
  }
  document.querySelector('span').innerHTML = document.querySelector('span').innerHTML + str + '
'; }