portal entry

select a category, or use search below
(searches all categories and all time range)

Map, Reduce, and Filter functions in ColdFusion

| View in Portal
October 19, 2017 06:23:45 AM GMT
1 Comment
Functional programming has gained popularity in the recent past. Using functional programming techniques, you can write code that is relatively bug-free, easier to debug and test, and easier to refactor. One of the reasons why functional programming has become popular is its ability to manipulate data structures easily and efficiently when compared to traditional methods. In this blog, we shall take a close look at the pillars of functional programming, map, reduce, and filter, and how you can use these […]
Labels: Blog, filter, functional programming, map, map reduce filter function, redhat


One thing that I found that isn't documented in the Adobe Help. In ArrayMap (which may operate differently from just plain map), Adobe shows only (item) which is the individual data in the iteration.  But, if you use (item,index), you also get the index of the array. animals=["cat","dog","horse","lion","tiger"]; arrayMap(animals,function(item,index){ writeOutput("Animal number " & index & " is a " & item & "<br />"); });
Comment by WolfShade
1753 | February 13, 2019 08:17:05 PM GMT