DEV Community

loading...

Array.map

Joe Enos
Software developer/architect, mostly working with .NET and SQL Server.
・1 min read

One of the most useful array functions in JavaScript is the map function. It allows you to take an array, convert each item using whatever function you define, and return an array of the same size and in the same order.

If you're a .NET developer, this is basically equivalent to the "Select" LINQ method, except you've got a little bit more you can do here, with the second and third parameters.

Here's a video showing some simple examples:

Discussion (0)