f/cfml

Stump the Programmer: The Recursive Shelf

Stump the Programmer: The Recursive Shelf

Robert presents a ColdFusion/BoxLang coding challenge to build a recursive function that converts a flat array of hierarchical category data (using `id` and `parent_id` relationships) into a nested tree structure without using loops. The solution uses `arrayFilter()` to find children of each parent and `arrayMap()` to recursively build the `children` array for each node, with an optional bonus feature to alphabetically sort children at each nesting level using a `sortKey` parameter.

kisdigital.com View

Comments

No comments yet. Log in to start the conversation.

f/cfml

Adobe ColdFusion, Lucee, and BoxLang

Created Feb 13, 2026

2  Members

Moderators
u/rob