title: What is the best way to iterate properties inside a JavaScript Object?
body: <p>I have the following javaScript object:</p>
  
  <pre><code>var theData = {
     "data": [
        {
           "name": "Event1",
           "start_time": "2015-01-15T22:00:00-0200",
           "end_time": "2015-01-16T07:00:00-0200",
           "timezone": "America/Sao_Paulo",
           "location": "Somewhere",
           "id": "824583590897935"
        },
        {
           "name": "Event2",
           "start_time": "2015-01-14T22:00:00-0200",
           "timezone": "America/Sao_Paulo",
           "location": "Somewhere",
           "id": "1522505051359796"
        }
     ],
     "paging": {
        "cursors": {
           "after": "MzA0MjY5OTI5NzgwODIz",
           "before": "ODI0NTgzNTkwODk3OTM1"
        },
        "next": "https://graph.facebook.com/v2.2/217733628398158/events?access_token=CAACEdEose0cBAAW4SjUBnZB9x1Y6euJS6Bbmky2ZBfyMJ7eq4hPyy0g6lrk9itZCS2Rf2vmAmlYS6qcwIBLVs8Vm5ZBnDYbW7ldni3LdmwAqrZAjVXQrloT0nunu6brW21tBzRXyZAyLR7L2oaF14cmusoXzndsadsakvsZyAYSkjQ52g57BW3VqbAHEMQnTtq5uYb4NOHN5xa1IvdecZCgSHNHzKPWYq1VsWZB7qvQgHXvoRAZD&amp;limit=25&amp;after=MzA0MjY5OTI5NzgwODIz"
     }
  }
  </code></pre>
  
  <p>So i want to iterate over this object. 
  I have the following code that is working. But I'm new to Javascrip and this way i'm doing is a high complexity way. How could i do it as simple as possible once this will be called for a huge amount of times? </p>
  
  <pre><code>for (var key in theData) {
     var obj = theData[key];
     for (var prop in obj) {
        var eventObj = obj[prop];
        for (var attribute in eventObj){
           if(eventObj.hasOwnProperty(attribute)){
              console.log(attribute + " = " + eventObj[attribute]);
           }
        }
     }
  }
  </code></pre>