map
Description
Loop through all the elements in a list to apply a specific operation to each element.
Example: loop through a list of numbers to square (operation to be applied) every number.
Input / Parameter
values
The list of elements to loop through.
Array/List
-
-
Yes
extra
Extra parameters stored and passed to callback.
Any
-
-
No
Output
N/A
Callback
yesCallback
This will be triggered for every loop that happens within the 'values'.
The current active value within the 'values'.
Any
Video
Coming Soon.
Example
The user wants to loop through all the values in an array.
Step
Set a variable "Vmap" using the
setVar
function. Call the functiontoArray
in thevalue
parameter and set the values for the list. var: VmapCall the function
map
. Call the functiongetVar
in thevalues
parameter and enter the variable to get. var : getVar->VmapAdd a
console
function to the callback of themap
function to display the result in the console.
Result
Links
Last updated