最終更新:2022-07-28 (木) 11:11:32 (638d)  

Array.prototype.map
Top / Array.prototype.map

与えられた関数を配列のすべての要素に対して呼び出し、その結果からなる新しい配列を生成します。

https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/map

構文

let new_array = arr.map(function callback( currentValue[, index[, array]]) {
    // 新しい配列の要素を返す
}[, thisArg])

JavaScript/アロー関数

関連