map() Method

By: Dusty Arlia
Published on Friday, June 7, 2013, 04:57 PM
Last Updated on Sunday, July 12, 2015 at 2:34 PM
Total Updates: 3

The map() method is accessed from an array object using dot-syntax. Here is the basic syntax:

[array_name].map([callback_function][, [argument_name]])

The map() method performs a function (callback_function) on every element in that array (array_name). The result is the creation of a new array.

The callback_function creates a new array element from an element of the current array. argument_name is an object to be used as this when executing the callback_function. The second parameter, argument_name, is seldom used.

Comments:

Ad: