>
<p>Use <code>Array</code> methods such as <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"><code>map</code></a> to iterate over lists of data</p>
<pre><code class="lang-javascript">var users = [
    {name: &quot;John&quot;},
    {name: &quot;Mary&quot;},
]

m(&quot;ul&quot;, users.map(function(u) { // &lt;ul&gt;
    return m(&quot;li&quot;, u.name)      //   &lt;li&gt;John&lt;/li&gt;
                                //   &lt;li&gt;Mary&lt;/li&gt;
}))     