Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. square = (x) -> x*x
  2.  
  3. l = [1,2,3,4]
  4.  
  5. printL = (curList) ->
  6.     res = ""
  7.     for x in curList
  8.         res = res + " " +x
  9.     res
  10.  
  11.  
  12. myFunc = (curList) ->
  13.     for x in curList
  14.         do (x) ->
  15.             square (x) ->
  16.                 x+3
  17.  
  18. alert (printL (myFunc l))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement