Sorry, this video is for subscribers only.

Click here to subscribe!

Refactoring for the Win

There’s two more functions to rewrite before we can get rid of JQuery in HtmlCoordinate: our fail-fast code and our conversion from element-relative offsets to page offsets. The fail-fast code turns out to be a bit tricky, so we work on toRelativeOffset() instead. It’s a great example of how refactoring first can make code easier to write.

comments powered by Disqus