I get a list of users from the server as an array of objects, then I want to turn this array into an html table. The problem is that I do not want to pre-create the header row of the table, I would like to form it from the keys that the objects have.
fetch('get_url')
.then(response => response.json())
.then(data => { obj = data })
.catch(error => console.error(error))
An obj array containing the following objects:
0: {…}
age: "19"
company: "sunplace"
experience: "10"
gender: "male"
lastname: "Parker"
placeofwork: "Airport"
specialty: "cleaner"
username: "Fred"
1: {…}
age: "18"
company: "sunplace"
experience: "10"
gender: "male"
lastname: "Branton"
placeofwork: "Airport"
specialty: "cleaner"
username: "Lar"
2: {…}
age: "20"
company: "sunplace"
experience: "3"
gender: "female"
lastname: "Kollin"
placeofwork: "Airport"
specialty: "cleaner"
username: "Laral"