title: Loop through an object and append the properties to an html file
body: <p>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?</p>
  
  <pre><code>var person = {
      firstName: "john",
      lastName: "doe",
      age: 45,
      placeOfBirth: "somewhere"
  }
  
  for(var i = 0; i &lt; person.length; i++) {
      if(hasOwnProperty(person[i])) {
          var p = document.createElement("p");
          p.innerHTML = person[i];
          document.body.appendChild(p)
      }
  }
  </code></pre>