How do I get result like this from a javascript array?

Printable View