问答详情
源自:4-5 展示添加的文件列表

老师这段代码有问题 报错pathes.reduce is not a function

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>`

}



提问者:慕后端4726891 2019-12-08 01:32

个回答

  • 榊原
    2020-01-19 09:47:21

    老师的代码没有问题 你的pathes传入的是个数组吗