I have a JSON node called 'data' that has an id. I want to store the value of that id but I'm unable to do so with my current syntax and I'm getting an error saying it's undefined.
How should I change my code to make this work?
My code snippet:
const transfer_ID = data.items.id;
console.log("This is the transfer tree obtained", data);
data:
{ entity: 'collection',
count: 1,
items:
[ { id: 'trf_Ary1cWasdfGmHAc',
entity: 'transfer',
source: 'pay_ASrxasdfetwhAFv',
amount: 390000,
currency: 'INR',
amount_reversed: 0,
notes: [],
fees: 1151,
tax: 176,
on_hold: false,
on_hold_until: null,
recipient_settlement_id: null,
created_at: 1530208843 } ] }