JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://leaverou.github.io/prefixfree/prefixfree.js"></script>
JavaScript
let cats = ['titi', 'tata', 'toto', 'tutu', 'tete'];
let nbr;
let txt="";
let i;
nbr = cats.lenght;
console.log(nbr);
for (i=0; i<(nbr-1); i++)
txt += cats[i] + ", ";
txt += cats[i] + ".";
console.log(txt);