最好的种树是十年前,其次是现在。歌谣 每天一个前端小知识 提醒你改好好学习了 知乎博主 csdn博主 b站博主  放弃很容易但是坚持一定很酷     我是歌谣 喜欢就一键三连咯 你得点赞是对歌谣最大的鼓励

1前言

在我们的日常开发中 不免会有很多需要处理数据的方法 本节主要说一说map的使用

话不多说 编辑器搞出来 一起研究研究数组中的map方法

 

 

2代码部分

    var geyao=['歌谣',"很帅","很强"]
    geyao.map((currentValue,index,arr,thisValue)=>{
        console.log(currentValue,"currentValue")
        console.log(index,"index")
        console.log(arr,"arr")
        console.log(thisValue,"thisValue")
    })

3运行结果

 

4总结

currentvalue 当前元素的值 index 索引值 arr 当前元素属于的数组对象 thisValue 对象作为该执行函数的回调