Last active
December 21, 2015 23:30
-
-
Save skywritergr/a1d59e20532694270b69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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