forEach

Summary

Executes the specified function on each array element.

Signatures

Click on a signature to select it and view its documentation.

Usage

public void forEach(void(T currentValue) callback)

Parameters

callback

A function which provides the operation logic.

Description

Executes the specified function on each array element.

This method was standardized in ECMAScript 5 for JavaScript. For web browsers that do not support ECMAScript 5, JS++ will provide a polyfill for this method only if it is used.

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
int[] numbers = [ 2, 4, 6, 8, 10 ];
numbers.forEach(void(int currentValue) {
    Console.log(currentValue + 1);
});

Share

HTML | BBCode | Direct Link