Skip to content

Instantly share code, notes, and snippets.

@kristoferjoseph
Created January 12, 2017 20:47
Show Gist options
  • Save kristoferjoseph/c866f9946fd5e3c881c293b8948c061b to your computer and use it in GitHub Desktop.
Save kristoferjoseph/c866f9946fd5e3c881c293b8948c061b to your computer and use it in GitHub Desktop.
pseudo code for child an sibling element comparisons
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