Nested Arrays vs Nested Objects

This example shows the same data in two different structures: one using nested arrays, the other using nested objects.

Nested Array Format


      
Access example: data[0][1] → Capital of first state

Nested Object Format


      
Access example: data["New York"].city → Capital of New York