JXtension - Function.map(arrayToMap)

Purpose:
Give the user the ability to execute a function multiple times, using each element of an array as the parameter(s) for the specified function.

Parameters:

arrayToMap The array containing elements, each of which will be used as the parameter(s) for a single call of the function being used.
[thisObj] The object in the function that is referred to by the keyword this.

Returns:
Returns array of the same length as that which was passed.  Each element in this new array will correspond with the parameter(s) which was found in arrayToMap.

Example #1:
The following code will run the custom showNumber function with the three numbers that are in the arrToMap variable:

 

Example #2:
The code below will use the map function to add multiple pairs of numbers together.  Unlike in the previous example, this one illustrates the fact that you can send multiple parameters to the function by storing arrays within the top-most array:

 
, ") + "]");