title: What Is The Meaning Of This JS DOM Code?
body: <p>I found this function to find the JS DOM methods. However, I couldn't understand the logic behind it.</p>
  
  <pre><code>for (var l in document.body){
    console.log("document."+l+":"+document.body[l]);
  }
  </code></pre>
  
  <p>What does the var 1 mean? It seems, document.body is an array and we are iterating over the array. However, something seems strange. In the above code, when I insert spaces around "1" and ":" inside the for loop, it's showing different results. (It is adding the "1" as a string.) And without the spaces, it is returning the property and method names.</p>
  
  <p>Can someone please break down the meaning of the code to me? Thanks.</p>