JSFiddle - React, Tailwind, and code Playground

HTML

<ul>
    <li>ciao</li>
    <li>Hello</li>
    <li>Hola</li>
</ul>

JavaScript

var items = Array('the', 'and', 'to', 'a');
  $('li').each(function () {
      var randomNum = Math.floor(Math.random() * items.length)
      var item = items[randomNum];
      $(this).append(item);
      items.splice(randomNum, 1);
      
  });