const renderListHTML = (pathes) => {
const musicList = $('musicList')
const musicItemsHTML = pathes.reduce((html, music) =>
html += `<li class="list-group-item">${path.basename(music)}</li>`
)
musicList.innerHTML = `<ul class="list-group">${musicItemsHTML}</ul>`
}
老师的代码没有问题 你的pathes传入的是个数组吗