Skip to content

Each

Executes the given callback function for every row in the data table.

1
myDataTable.Each(fn: (row: DataRow) => void):DataTable

Executes the given callback function for every row in the data table.

1
myDataTable.Each(fn: (row: DataRow, i: number) => void):DataTable

Parameters

(row: DataRow) => void fn
    A function to call for every data row.

Returns

The current DataTable instance. The current DataTable instance.

Remarks

If the callback function is null, an error is thrown.

Scan all rows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
var table = $Database.Get({
    Parameters : {
        TargetSchema : 'HR',
        TargetTable : 'Groups'
    }
});

table.Each(function () {
    var id = this.Id;
});

If the callback function is null, an error is thrown.

See Also