'How can I iterate (if possibile) in Thymeleaf over a list returned by a javaScript function?

My Thymeleaf code:

<div class="funzionalitaDecor" th:each="azienda : ${prova()}">
  <div th:text="${azienda.}" th:value="${azienda}" style="cursor: pointer;"></div>
</div>

My Java Script code:

function prova(){
  const lista = ["prova1", "prova2", "prova3"];
  return lista;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source