I have three data coming back from an ajax call. I pack them into an array like this:

```
return json_encode([$salesOrder, $soAddressDetails, $lineItems]);

```

I then go to the view and look at the return. I see (as an example) this:

```
[
    [{
        "id": 8591,
        "reference": "MYCLIENT",
        "name": "MYCLIENT COMPANY \u00a3",
        "allocated_status": "",
        "created_at": "2016-12-02 09:31:00",
        "order_date": "2016-12-02",
        "cust_order_number": "",
        "del_name": "",
        "consignment": "",
        "despatch_date": "0000-00-00",
        "notes_2": ""
    }],
    [],
    [{
            "id": 11691,
            "qty_ordered": 1,
            "qty_delivered": 0,
            "sales_order_id": 8591,
            "due_date": "2016-12-30",
            "stock_code": "ABC-ABDCDE-01",
            "record_deleted": 0,
            "updated_at": null,
            "unit_price": 0,
            "sales_order_item_id": null,
            "comment": null,
            "created_at": null,
            "firmware_version": null,
            "units_assigned": null
        },

        {
            "id": 11692,
            "qty_ordered": 1,
            "qty_delivered": 0,
            "sales_order_id": 8591,
            "due_date": "0000-00-00",
            "stock_code": "MISCELLANEOUS",
            "record_deleted": 0,
            "updated_at": null,
            "unit_price": 232,
            "sales_order_item_id": null,
            "comment": null,
            "created_at": null,
            "firmware_version": null,
            "units_assigned": null
        }
    ]
]

```

In theory all I should need to access this, as array `result` is:

```
result[0] // sales order details
result[2] // line items = array of objects

```

so 

```
result[0].reference == 'MYCLIENT'

```

and

```
result[2][0].stockcode == 'ABC-ABDCDE-01

```

but it won't let me do that. if I `console.log(result[0])` the result is `[`, if I `console.log(result[0][0].id)` the result is `undefined`.

what am I doing wrong?