Aetae,
<body>
<script>
let word = ['t', 'e', 'x', 't', ',', 'w', 'o', 'r', 'l', 'd', ',', 't', 'a', 'x'];
let src = 0;
for (let i = 0; i < word.length; i++) {
if (word[i] === ',') {
document.body.append(src + ' ');
src = 0;
} else {
src++;
}
}
document.body.append(src + ' ');
</script>
</body>