Javascript — Writing Map as a Recursive Function

The Map Function

const myArray = [1,2,3,4,5]const newArray = myArray.map(arrayItem => arrayItem + 1)console.log(newArray) // [2,3,4,5,6]