Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var recursivelyToggle = function recursivelyToggleChildren(array){
var localArray = array;
for(var i=0;i<localArray.length;i++){
var node = localArray[i];
toggleFlag(node); // toggles the flag of the node.
if(node.children){
node.children = recursivelyToggleChildren(node.children);
}
}
return localArray;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.