Return multiple values: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
imported>Thebeez
(Added functionally identical alternative to clarify comment.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 3,431:
=={{header|Wren}}==
In Wren, one would return multiple values from a function or method by using some sort of Sequence object, usually a List though a Map could be used if you needed ''named'' returns.
<syntaxhighlight lang="ecmascriptwren">var splitName = Fn.new { |fullName| fullName.split(" ") }
 
var names = splitName.call("George Bernard Shaw")
9,476

edits