Apply a callback to an array: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: fixed a couple of syntax glitches, added personal tag)
Line 1,834: Line 1,834:
</lang>
</lang>


=={{header|Mathematica}}==
=={{header|Mathematica}}//{{header|Wolfram Language}}==
<lang Mathematica>(#*#)& /@ {1, 2, 3, 4}
<lang Mathematica>(#*#)& /@ {1, 2, 3, 4}

Map[Function[#*#], {1, 2, 3, 4}]
Map[Function[#*#], {1, 2, 3, 4}]

Map[((#*#)&,{1,2,3,4}]
Map[((#*#)&,{1,2,3,4}]

Map[Function[w,w*w],{1,2,3,4}]</lang>
Map[Function[w,w*w],{1,2,3,4}]</lang>