I have an arbitrarily nested data structure like this -
var nested = [ 'a', [ [ 'b' ], [ 'c' ] ] ];
I would like to traverse the levels to create an array of arrays like this
var paths = [['a', 'b'] ['a', 'c']];
I know this is going to take recursion. Any ideas?!
The question is a bit vague, but here is an interesting function taken from object-scan that you might be able to modify for your need.
Note that some assumptions about the input are being made that you didn't specify