Hi I am new to JavaScript and have been doing some practice stuff. I am struggling with looping through an Object's properties and appending each property to the DOM. Can someone provide some guidance please? I tried piecing this together through other questions but not sure where I am going wrong?
var person = {
    firstName: "john",
    lastName: "doe",
    age: 45,
    placeOfBirth: "somewhere"
}
for(var i = 0; i < person.length; i++) {
    if(hasOwnProperty(person[i])) {
        var p = document.createElement("p");
        p.innerHTML = person[i];
        document.body.appendChild(p)
    }
}
 
     
     
    