How to traverse childNode.length

I’m trying understand childNodes and trying to traverse the childNode.length, but when I log the function I just get the entire function written once more in console. But not the childNode length’s content. i.e [<p>,apple,</p>,<p>,orange,</p>]


        <div id="nodes">

   <div id="listofnodes"></div>
   const Childnodes = document.getElementById('nodes').childNodes;

function Childnodes_list(){
    let i = 0; 
    if (i <= childNodes.length, i++) {
       document.getElementById('listofnodes').innerHTML = (Childnodes[i]);

console.log (Childnodes_list);


Thank you very much for the input, I think have a better grasp now.