I am trying to get a value from an array within an object.
This is the data:
{
"Order Number":102541029,
"Tracking Number":192048236154915,
"Secondary Tracking":87350125235,
"Items":[{
"SKU":"0200-02-01-NP-P-00",
"QTY":4
},
{
"SKU":"0120-02-01-XP-T-00",
"QTY":2
}]
}
If I wanted, say, the quantity of the second item (SKU 0120-02-01-XP-T-00), how would I select this?
I've tried a few things like this:
var skuQty = datain.items.['0120-02-01-XP-T-00'].['QTY'];
That's the idea, but I am not using the right syntax obviously. Any help here?
- Jesse