I have this object
let listItem = {
name: "Lydia",
accountId: "HGVe",
fleetType: "Haulage"
};
I want to get an array which will be exactly like this:
[listItem.name, listItem.accountId, listItem.fleetType]
The values in the array don't have to be strings or values as you can see.
So every element of the array is going to be VariableName.key (not a string).
!!!!To be 100% clear, these 2 results are NOT what I need:
["listItem.name", "listItem.accountId", "listItem.fleetType"] // results are strings: WRONG
["Lydia", "HGVe", "Haulage"] // results are values: WRONG
As you can see above, the correct array have in each element a reference to the precise object.key