map()
The map()
function is a higher-order array function in JavaScript and TypeScript. It takes an array and a callback function as arguments, and it returns a new array with the results of the callback function applied to each element in the original array. In this example, the map()
function takes an array of numbers, numbers
, and returns a new array, doubledNumbers
, with each element of numbers
doubled.
Last updated