RosettaCodeData/Task/Loops-Foreach/Lingo/loops-foreach-2.lingo
2023-07-01 13:44:08 -04: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