I am having an issue getting accessing the value from a key of an object.
I am passing in this.fields which has 2 objects in an array like,
[{'First Name': 'firstName'}, {'Last Name': 'lastName'}]
I am able to get the keys using the Object.keys function, but cannot figure out how to get the values associated with them.
let properties = [];
for (let field of this.fields) {
console.log(field);
properties.push({
"name": Object.keys(field),
"value": ""
});
}
I have tried doing this.fields[field] to get it, but it is returning undefined. Any advice on how to approach this?