![used books you dont know js used books you dont know js](https://m.media-amazon.com/images/I/61WxM0FtgfL._CR180,0,1080,1080_UX175.jpg)
Make sure to add a code comment labeling each scope with its color.īONUS: identify any implied scopes your code may have.Ĭontains at least two function scopes and at least two block scopes.Īt least one variable from an outer scope must be shadowed by a nested scope variable (see Chapter 3).Īt least one variable reference must resolve to a variable declaration at least two levels higher in the scope chain. If you color all the scopes (including the global scope!) different colors, you need at least six colors. This exercise asks you to write a program-any program!-that contains nested functions and block scopes, which satisfies these constraints:
![used books you dont know js used books you dont know js](https://cdn.utaustinbootcamps.com/wp-content/uploads/sites/119/2020/06/best-ways-to-learn-javascript.jpg)
Remember Figure 2 from back in Chapter 2? Fig. If you're happy with your code, I am, too! Buckets of Marbles My hope is that you come away from this book feeling confident that you can tackle these sorts of coding tasks built on a strong foundation of knowledge. There's no judging you on how you write your code. Your approach may differ some (or a lot!) from the solutions presented, and that's OK. These exercises don't have a specific right answer that you have to get exactly.
![used books you dont know js used books you dont know js](https://images-na.ssl-images-amazon.com/images/I/81DNgHn+7JL._AC_UL140_SR140,140_.jpg)
It's a good idea to try out the exercises yourself-in an actual code editor!-instead of skipping straight to the solutions at the end. This appendix aims to give you some challenging and interesting exercises to test and solidify your understanding of the main topics from this book. You Don't Know JS Yet: Scope & Closures - 2nd Edition Appendix B: Practice