Data:
var data = [ { \"id\": 1, \"level\": \"1\", \"text\": \"Sammy\", \"type\": \"Item\", \"items\": [
Using _.flatMapDeep (available since Lodash 4.7):
_.flatMapDeep
var flatten = function(item) { return [item, _.flatMapDeep(item.items, flatten)]; } var result = _.flatMapDeep(data, flatten);