How to print array in Node.js

1 Answer

0 votes
const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];

console.log(array);
 
for(let i = 0; i < array.length; i++) {
    console.log(array[i]);
}
 
 
 
 
 
/*
run:
 
[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
1
2
3
4
5
6
7
8
9
0
 
*/

 



answered Oct 31, 2021 by avibootz
...