Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 08/23/2012
Components: Language, Closures
Versions: 10.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: Final / 285716
Priority/Frequency: Trivial / Unknown
Locale/System: English / Win All
Vote Count: 3
If I want to know which index each element is at, I need to infer that myself (ie: with the i variable that I maintain "by hand") . arrayEach() would be a lot more fully-realised if its callback was also passed the index. I think that a very high percentage of the time, one would want to know which element one is looking at, as well as the element value. It's a bit "jerry-built" to have to roll one's own.
<cfscript>
a = ["Tahi","Rua","Toru","Wha","Rima","Ono","Whitu","Waru","Iwa","Tekau"];
arrayEach(
a,
function(element){
param name="i" default=1;
writeOutput("#i++# #uCase(element)#<br />");
}
);
</cfscript>
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3316802
External Customer Info:
External Company:
External Customer Name: Adam Cameron.
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: