RosettaCodeData/Task/Nested-function/Sidef/nested-function.sidef
2023-07-01 11:58:00 -04:00

11 lines
202 B
Text

func make_list(separator = ') ') {
var count = 1
func make_item(item) {
[count++, separator, item].join
}
<first second third>.map(make_item).join("\n")
}
say make_list('. ')