Created
January 12, 2017 20:47
-
-
Save kristoferjoseph/c866f9946fd5e3c881c293b8948c061b to your computer and use it in GitHub Desktop.
pseudo code for child an sibling element comparisons
This file contains hidden or 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
function walk(n, o, update, target) { | |
tree = update(n, o, target) | |
n = n.firstChildElement | |
o = o.firstChildElement | |
target = tree.firstChildElement | |
while (n || o) { | |
walk(n, o, update) | |
n = n.nextElementSibling | |
o = n.nextElementSibling | |
} | |
} | |
function update (n, o) { | |
// fast returns | |
// morph | |
// return element | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment