map 方法第一个参数不是item嘛?为什么是index
来源:3-3 使用cheerio进行数据提取

哈士奇附体
2020-06-04
map 方法第一个参数不是item嘛?为什么是index
public getJsonInfo(html:string) {
const $ = cheerio.load(html)
const courseItems = $('.course-item');
console.log(courseItems)
courseItems.map((index, element)=> {
console.log(index, element)
})
}
写回答
3回答
-
哦哦,我知道了,这是cheerio的api,它自己就是反的。
112020-06-14 -
慕斯卡7269444
2021-09-14
https://github.com/cheeriojs/cheerio/wiki/Chinese-README#map-functionindex-element-
00 -
Dell
2020-06-07
我应该写错了
022020-06-20
相似问题