Apply a callback to an array: Difference between revisions

→‎{{header|NetLogo}}: corrected syntax. No curly braces in NetLogo
(Add Zig)
(→‎{{header|NetLogo}}: corrected syntax. No curly braces in NetLogo)
Line 2,067:
=={{header|NetLogo}}==
<lang NetLogo>
;; NetLogo “anonymous procedures”
show (map { { x } x * x } [ 1 2 3 4 5 ])
;; stored in a variable, just to show it can be done.
let callback [ [ x ] x * x ]
show (map { { x } x * x }callback [ 1 2 3 4 5 ])
</lang>