Answers for "print list in javascript"

3

how to print an array in javascript

var array = [1,2,3]

for(var i = 0; i < array. length ; i++){
  
console. log(array[i])
}

//This is how you print the elements of the array if it is useful!
//-Andrew Ma
Posted by: Guest on December-09-2020
1

how to print a array js

var array = [1,2,3]

for(var i = 0; i < array.length ; i++){
    console.log(array[i])
}
Posted by: Guest on June-05-2020
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 "Java"

Java Answers by Framework

Browse Popular Code Answers by Language