So i have this array of objects :
const arr = [
{
name: "Bob",
job: "Teacher",
age: 30
},
{
name: "Jack",
occupation: "Developer",
height: "160 cm"
}
]
My goal here is to get the property name(for ex : occupation) along with its value dynamically and display both of them using the map function in JS , because am using React to display the data.
(i know there's a way with Object.keys()) , but if there's a way with map it would be better for me
an example of the display for the 1st object would be :
name : bob
job : teacher
age : 30
Thanks in advance !