[{"data":1,"prerenderedAt":85},["ShallowReactive",2],{"content:\u002Fposts\u002F2023\u002Fjs-map":3,"surround:\u002Fposts\u002F2023\u002Fjs-map":73},{"id":4,"title":5,"body":6,"canonical":53,"categories":54,"date":56,"description":53,"draft":57,"extension":58,"image":59,"meta":60,"navigation":61,"path":62,"permalink":53,"readingTime":63,"recommend":53,"references":53,"seo":68,"sitemap":69,"stem":70,"tags":71,"type":53,"updated":56,"__hash__":72},"content\u002Fposts\u002F2023\u002Fjs-map.md","js拾遗--map",{"type":7,"value":8,"toc":48},"minimark",[9,14,18,29,32,42],[10,11,13],"h2",{"id":12},"map-函数的第二个参数","map 函数的第二个参数",[15,16,17],"p",{},"map 可以传递第二个参数，第二个参数的值会赋值给当前 this",[19,20,26],"pre",{"className":21,"code":23,"language":24,"meta":25},[22],"language-js","const lesson = {\n    name: \"课程\",\n    lessons: [\"js\", \"ts\", \"vue\"],\n    show() {\n        return this.lessons.map(function (lesson) {\n            return this.name + \"-\" + lesson\n        }, this)\n    },\n}\nconsole.log(lesson.show())\n","js","",[27,28,23],"code",{"__ignoreMap":25},[15,30,31],{},"当然，我们可以使用箭头函数",[33,34,35],"blockquote",{},[15,36,37,41],{},[38,39,40],"strong",{},"箭头函数的 this 就是函数执行上下文"," - 父级作用域的 this",[19,43,46],{"className":44,"code":45,"language":24,"meta":25},[22],"const lesson = {\n    name: \"课程\",\n    lessons: [\"js\", \"ts\", \"vue\"],\n    show() {\n        return this.lessons.map(lesson => this.name + \"-\" + lesson)\n    },\n}\nconsole.log(lesson.show())\n",[27,47,45],{"__ignoreMap":25},{"title":25,"searchDepth":49,"depth":49,"links":50},4,[51],{"id":12,"depth":52,"text":13},2,null,[55],"代码","2023-03-01 11:13:48",false,"md","https:\u002F\u002Fbitmc.uno\u002Fpicgo\u002F679ad63768138-78.webp",{},true,"\u002Fposts\u002F2023\u002Fjs-map",{"text":64,"minutes":65,"time":66,"words":67},"1 min read",0.595,35700,119,{"title":5,"description":53},{"loc":62},"posts\u002F2023\u002Fjs-map",[24],"NFsRgBbGVx2bGXAunqVIruu7rzuVP5F8f1YBbRKXnR4",[74,80],{"title":75,"path":76,"stem":77,"date":78,"type":79,"children":-1},"大同博物馆游览留念","\u002Fposts\u002F2023\u002Fdatong-museum-tour-souvenir","posts\u002F2023\u002FDatong-Museum-tour-souvenir","2023-02-11 12:31:14","story",{"title":81,"path":82,"stem":83,"date":84,"type":53,"children":-1},"degit -- 拉取项目（不包含提交记录）","\u002Fposts\u002F2023\u002Fdegit","posts\u002F2023\u002Fdegit","2023-03-28 20:47:28",1789642594105]