Сделать массив:
const arr = [
[ 'author', 'Author - ' ],
[ 'name', 'Name' ],
[ 'currentTime', '00:00' ],
[ 'duration', '00:00' ],
];
Который надо что? - правильно, перебрать, так или иначе:
arr.forEach(n => {
titleElement.appendChild(create({
el: 'span',
className: n[0],
text: n[1],
}));
});
// или
for (const [ className, text ] of arr) {
titleElement.insertBefore(create({
el: 'span',
className,
text,
}), null);
}
// или
for (let i = 0; i < arr.length; i++) {
titleElement.insertAdjacentElement('beforeend', create({
el: 'span',
className: arr[i][0],
text: arr[i][1],
}));
}
// или
titleElement.replaceChildren(...(function get(i, n = arr[i]) {
return n
? [ create({ el: 'span', className: n[0], text: n[1] }), ...get(-~i) ]
: [];
})(0));
А вообще, непонятно, зачем все эти странные функции, и без них отлично получается:
const title = document.createElement('div');
title.id = 'title';
title.append(...arr.map(([ className, innerText ]) =>
Object.assign(document.createElement('span'), { className, innerText })
));
document.getElementById('root').append(title);
// или
document.querySelector('#root').innerHTML = `
<div id="title">${arr.map(n => `
<span class="${n[0]}">${n[1]}</span>`).join('')}
</div>
`;