I have 4 lines to code
console.log(Object.keys(data));
console.log(data);
console.log(data['createTs']);
console.log(data.createTs);
output for 1st line :
[
"supplierName",
"supplierNbr",
"itemNbr",
"category",
"subCategory",
"receivingNodesInbound",
"whseOrderIds",
"orderType",
"overviewStatus",
"fromNode",
"orderSubTypes",
"itemDesc",
"importOrDomestic",
"event",
"systemCreatorId",
"createBy",
"channelMethod",
"source",
"freight",
"singleCreateTs"
]
Output for 2nd line:
{
"supplierName": "",
"supplierNbr": "",
"itemNbr": "",
"category": [],
"subCategory": [],
"receivingNodesInbound": "",
"orderType": [
"PO"
],
"overviewStatus": [],
"orderSubTypes": [],
"systemCreatorId": [],
"createBy": "",
"channelMethod": [],
"source": [],
"orderIds": [],
"hostNbr": [],
"lineStatuses": [],
"orderSubTypeList": [],
"categories": [],
"createTs": {
"startDate": "NaN-NaN-NaN"
}
}
3rd and 4th line is giving “undefined”.
I couldn’t understand why its giving undefined. How can I access createTs from data object?