Implementing For Each in JScript
function forEach(enumerable, delegate)
{
for (var enumerator = new Enumerator(enumerable); !enumerator.atEnd(); enumerator.moveNext())
{
delegate(enumerator.item());
}
}
Used like this:
forEach(employees,
function(employee)
{
WScript.Echo(employee.Salary);
});