RosettaCodeData/Task/Nested-function/Jsish/nested-function.jsish

22 lines
338 B
Text
Raw Normal View History

2023-07-01 11:58:00 -04:00
/* Nested function, in Jsish */
function makeList(separator) {
var counter = 1;
function makeItem(item) {
return counter++ + separator + item + "\n";
}
return makeItem("first") + makeItem("second") + makeItem("third");
}
;makeList('. ');
/*
=!EXPECTSTART!=
makeList('. ') ==> 1. first
2. second
3. third
=!EXPECTEND!=
*/