JavaScript packs some nifty tools that allow you to get crafty with arrays. Let’s explore one of the most common methods you’ll come across when dealing with array iteration and manipulation.
JavaScript打包了一些漂亮的工具,使您可以熟练使用数组。 让我们探讨在处理数组迭代和操作时会遇到的最常见的方法之一。
“The map()
method creates a new array populated with the results of calling a provided function on every element in the calling array.”
“ map()
方法创建一个新数组,其中填充了在调用数组中每个元素上调用提供的函数的结果。”
…eh?
……嗯?
![Image for post](https://img-blog.csdnimg.cn/img_convert/af267f082921c4d9bb0405a13abd75b1.png)