JSFiddle - React, Tailwind, and code Playground

HTML

<p>dont want to display the arry in this way</p>
<li id="list"> </li>
<br>
<p>Instead I want to display the list as</p>

<!-- where qtty is quantity -->
<li> 1 has a qtty x3 </li>
<li> 2 has a qtty x4 </li>

JavaScript

var list = [1,1,1,2,2,2,2]

document.getElementById("list").innerHTML = list;