Greg Lockwood
1 min readApr 18, 2017

--

Nice succinct article with some handy JS debugging tips.

I suggest that in traceFn(), you return fn.apply(...) in order to maintain the contract of the original function, otherwise it will break for functions that return values.

For readers who rely on Google Chrome’s Developer Tools like I do, I recommend adding these functions as snippets so you can easily add them to a page when you need them.

I put all 3 together on a global Debug object for easy access and namespacing. My snippet is available as a gist.

--

--