ForEach

From NSB App Studio
Revision as of 19:52, 9 October 2014 by Ghenne (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

ForEach(array, function)

Description

ForEach calls function on each element of array.

Example (Basic)

Rem ForEach Example
Dim School
School = Array("Principal", "Mr. Garrison", "Chef")
ForEach(School, listItem)

Function listItem(item)
  Print item
Next

Example (JavaScript)

// ForEach Example

var School;
School = new Array("Principal", "Mr. Garrison", "Chef");
School.forEach(listItem)

function listItem(item){
  NSB.Print(item);
}

Output

Principal
Mr. Garrison
Chef

Related Items

Do...Loop, Exit, For...Next, While...Wend, For Each...Next