JavaScript: Node List to Array Conversion
<p>I am trying to convert Node List to Array. I want to print the list (<code>caption 1,...caption 5</code>), but it prints:</p>

<p><code>[object HTMLLIElement],[object HTMLLIElement],[object HTMLLIElement],[object HTMLLIElement],[object HTMLLIElement],[object HTMLLIElement]</code></p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
    &lt;title&gt;Caption&lt;/title&gt;
&lt;style&gt;
    .captn {
    position: absolute;
    padding: 10px;
    margin: 200px auto;
    text-align: center;
    font-family:serif, fantasy;
    font-size:36px;
    color: #009933;
    text-decoration: none;
    text-transform: uppercase;
    list-style-type: none;
}
&lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;


 &lt;div&gt; 
    &lt;ul id = "caption" class="captn"&gt;&lt;li id = "caption0"&gt;caption 0&lt;/li&gt;&lt;li id = "caption1"&gt;caption 1&lt;/li&gt;&lt;li id = "caption2"&gt;caption 2&lt;/li&gt;&lt;li id = "caption3"&gt;caption 3&lt;/li&gt;&lt;li id = "caption4"&gt;caption 4&lt;/li&gt;&lt;li id = "caption5"&gt;caption 5&lt;/li&gt;&lt;/ul&gt;
 &lt;/div&gt; 

&lt;script&gt;

    var msg;
    var cap = [];
    var capList;

    var f = document.getElementsByClassName("captn");
    msg = f.item(0).childNodes;
    b = f.item(0).childNodes.length;
    var classAr = Array.prototype.slice.call(msg);

    document.write(classAr);


&lt;/script&gt;       

&lt;/body&gt;
&lt;/html&gt;
</code></pre>