Duplicate
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Adam CameronAdam CameronPriority
MajorNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Details
Details
Assignee
Pothys - MitrahSoft
Pothys - MitrahSoftReporter
Adam Cameron
Adam CameronPriority
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Created 1 February 2015 at 16:04
Updated 14 July 2021 at 07:07
Resolved 7 July 2021 at 14:45
Copied from https://issues.jboss.org/browse/RAILO-3147
This should work:
rainbow = ["Whero","Karaka","Kowhai","Kakariki","Kikorangi","Tawatawa","Mawhero"];
asString = rainbow.reduce(function(reduction="", colour){
reduction &= colour;
return reduction;
});
writeDump([rainbow,asString]);
Note how I am defaulting the reduction argument, instead of passing an empty string to reduce() as a starting value. Both approaches are valid (and supported in CF11).
However it errors with:
variable [REDUCTION] doesn't exist