ally can also potentially trigger expensive deoptimizations (such as an entire template being recreated from scratch)</p>
<pre><code class=language-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;ul&quot;, list)
    }
}</code></pre>
<p>Instead, prefer using JavaScript expressions such as the ternary ope