4 ms·
Yeah, it's a great resource. I'd love to see more examples as well. Bonus points if the examples are runnable and extra-bonus points if there's a 'debugger' ver
by stdgy 9y ago
Yeah, it's a great resource. I'd love to see more examples as well. Bonus points if the examples are runnable and extra-bonus points if there's a 'debugger' version that would let the user jump into a portion of the code to examine the state.
I find one of the first things I do when approaching non-trivial new features is to sketch out an example and then step through the example by adding a few strategically placed breakpoints. The breakpoints allow me to examine both the execution flow and the internal state of the various objects associated with the new feature.
Both Chrome and FF support the handy 'debugger' statement, which you can place directly in your code and which acts as a breakpoint when you run the code with devtools open.
Edit: Apparently the debugger statement is standardized! Neat. Didn't realize that. Thanks MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...