 an HTML tree, making the code more verbose and harder to understand. Constructing an virtual DOM tree procedurally can also potentially trigger expensive deoptimizations (such as an entire template being recreated from scratch)</p>
<pre><code class="lang-javascript">// AVOID
var BadListComponent = {
    view: function(vnode) {
        var list = []
        for (var i = 0; i &lt; vnode.attrs.items.length; i++) {
            list.push(m(&quot;li&quot;, vnode.attrs.items[i]))
        }

        return m(&quot