Answers for "how to print a list in javascript"

0

how to print a list in javascript

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 + '<br />';
}
Posted by: Guest on August-01-2021

Code answers related to "how to print a list in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language