I am attempting to add key-value pairs into an array while ensuring their uniqueness.
Currently, I am trying the following approach:
for (const [key, value] of Object.entries(check)) {
console.log(`${key}: ${value}`);
this.inputFields.push({
//`${key}' : '${value}`
})
}
The Console.log output displays the correct values:
Username: ''
Password: ''
My goal is to populate the inputFields with the keys and values so that the input fields appear as:
Username:
Password:
I want to achieve this dynamically without hardcoding it, as each object in my array contains different keys and values.