How to tabulate array key values using console.table

console.table is a function for tabulating arrays key value pairs it retuns a table when given an array as input.

const table = Array(5).fill(0)
console.table(table)



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

Comments

Popular posts from this blog

JavaScript introduction to variables

Solutions to blocked URLs on Facebook

How to stop moz dotbot from accessing your website

How to set content disposition headers for express nodejs apps

How to set content disposition header for nginx server to force content download