JavaScript Element.length returns invalid length while executing in Visualforce page.
I'm expecting body NodeList length to be 14. But after printing console.log('allDocElements length:: ',allDocElements.childNodes.length);
It return 10. how this is possible?
I'm executing it in Google Chrome.
<apex:page showHeader="false" sidebar="false">
<html>
    <head>
        <title>JS Addignment 1</title>
        <style>
            body {
                text-align:center;
                font-size:30px;
            }
            .center {
                width:70%; 
                margin:15% auto;
                border-collapse:collapse;
                border:2px solid #000000;
            }
            table td {
                border:2px solid #000000;
            }
        </style>
        <script>
        let dateContainer, dayContainer, timeContainer;
        let allDocElements = document.getElementsByTagName('body')[0];            
        console.log('allDocElements::',allDocElements.childNodes);
        </script>
    </head>
    <body>
        <table border="1" style="" class="center" cellpadding="20">
            <tbody>
                <tr>
                    <td><label>Date: </label><span id="dateContainer"/></td>
                    <td><label>Day: </label><span id="dayContainer"/></td>
                </tr>
                <tr>
                    <td colspan="2"><span id="timeContainer"/></td>
                </tr>
            </tbody>
        </table>
    </body>
</html>