Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
20
Task/Call-a-function/Lingo/call-a-function-7.lingo
Normal file
20
Task/Call-a-function/Lingo/call-a-function-7.lingo
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
----------------------------------------
|
||||
-- One of the five native iterative methods defined in ECMAScript 5
|
||||
-- @param {list} tList
|
||||
-- @param {symbol} cbFunc
|
||||
-- @param {object} [cbObj=_movie]
|
||||
-- @return {list}
|
||||
----------------------------------------
|
||||
on map (tList, cbFunc, cbObj)
|
||||
if voidP(cbObj) then cbObj = _movie
|
||||
res = []
|
||||
cnt = tList.count
|
||||
repeat with i = 1 to cnt
|
||||
res[i] = call(cbFunc, cbObj, tList[i], i, tList)
|
||||
end repeat
|
||||
return res
|
||||
end
|
||||
|
||||
on doubleInt (n)
|
||||
return n*2
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue