I want to fetch a property list from a json array. below is json array
[ { treeName: 'tree_A', prefix: 'prefix' }, { treeName: 'tree_b', prefix: 'prefix1/' } ]
After running code, my expectation result is ["tree_A","tree_B"];
Below is my implementation:
var treeNames = [];
for (var index = 0; index < config.treeSources.length; index++) {
treeNames.push(config.treeSources[index].treeName);
}
I want to find a best implementation to make code beautiful..
any one want to play it?