category: collections.cfc


Map and Reduce in Coldfusion, a pratical example


 
A few weeks ago I started a project called Collections.cfc that brings iteration functions such as map(), reduce() and filter() to Coldfusion collections. JavaScript and a few other languages have had these features for some time so I felt that it would be fun to try and bring that behavior over into the CF world.

Traditionally, functions such as map() and reduce() have been limited to Arrays, but being that Coldfusion rocks hard \m/, I wanted to go one step further and extend the functionality to Structures as well.

This example makes use of both types of collections types (arrays and structs) and several Collections.cfc methods to find the most popular keywords used in the descriptions of the blogs that ColdfusionBloggers.org aggregates. read more...