Apply a callback to an array: Difference between revisions

Updated D entry
(→‎{{header|Go}}: replace with Ruby translation)
(Updated D entry)
Line 401:
 
void main() {
auto arrayitems = [1, 2, 3, 4, 5];
auto m = items.map!(x => x + 5)(array);
writeln(m);
}</lang>
{{out}}
Output:
<pre>[6, 7, 8, 9, 10]</pre>