Currently coding the site

Notes

Understand them as Lorem Ipsum

Walking the DOM

Mar 11, 2008

As an experiment I had the idea of implementing the iterative version of the walk the DOM recursive function (which uses firstChild and nextSibling DOM methods to walk the DOM tree as a binary tree). One of the conditions was I didn't want to use a stack in the iterative implementation. At some point, I had the hope that it could be faster than the recursive one due to the absence of the function-call overhead but that didn't happen.

With that said I will leave the code here for anyone who wants to spend more time playing with it or provide some feedback.

Source code

View all notes...