How print an array formatted as table in Node.js

1 Answer

0 votes
const arr = [34, 76, 89, 99, 15];

console.table(arr);




/*
run:

┌─────────┬────────┐
│ (index) │ Values │
├─────────┼────────┤
│    0    │   34   │
│    1    │   76   │
│    2    │   89   │
│    3    │   99   │
│    4    │   15   │
└─────────┴────────┘

*/

 



answered Nov 23, 2022 by avibootz
...