In JavaScript, it is possible to loop through an object using the Object.keys
method.
With this, I can loop the person
Object as:
let person: {
name: "John",
lastName: "Doe",
age: 31,
}
for (let key of Object.keys(person)) {
console.log(person[key])
}
Now, how is it possible to do this if the person
has arrays as properties?
person: {
name: "John",
lastName: "Doe",
age: 31,
address: [{
street: "A Street Name",
number: 190,
apartment: 13
}]
}