RosettaCodeData/Task/Loops-Foreach/Lingo/loops-foreach-2.lingo
2016-12-05 23:44:36 +01:00

13 lines
413 B
Text

----------------------------------------
-- One of the five native iterative methods defined in ECMAScript 5
-- @param {list} tList
-- @param {symbol} cbFunc
-- @param {object} [cbObj=_movie]
----------------------------------------
on forEach (tList, cbFunc, cbObj)
if voidP(cbObj) then cbObj = _movie
cnt = tList.count
repeat with i = 1 to cnt
call(cbFunc, cbObj, tList[i], i, tList)
end repeat
end