Last active
August 29, 2015 13:56
-
-
Save jasminetsai/9319944 to your computer and use it in GitHub Desktop.
Secrets of the Javascript Ninja
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Guided reading questions for Chapter 1-5 (skips over first two chapters, since they are mostly introductory) | |
Chapter 3. Functions are fundamental | |
1. What is the difference between a function declaration and a function expression? | |
2. Give an example of a callback function used (consult common JS libraries or any code base you know!) | |
3. What is an anonymous function? Why is it useful? | |
4. What happens when a function is declared at the top level? | |
5. How are scopes declared in Javascript? | |
6. What are the four main ways you can invoke a function? | |
7. What are the implicit parameters passed in every function? | |
8. What happens when the size of your parameters list does not match the actual argument list? Can you find any code examples where this happens and is utilized? | |
9. What is "this" when you invoke a top level function? | |
10. How is a method defined in Javascript? What is "this" in a method? | |
11. What does a constructor do? What is "this" in a constructor? What is returned by a constructor? | |
12. What is the main difference between apply() and call()? | |
Chapter 4. Wielding Functions | |
1. What is an inline named function? What is it used for, and what principle in Javascript is it relying on? | |
2. How can functions be referenced? | |
3. Give an example where functions are used with attached properties | |
4. Give an example where passing in explicit context to a function can be useful | |
5. What are some of the techniques you can use to perform function overloading? | |
6. Give an example of function overloading in a JS library | |
Chapter 5. Closing in on closures | |
1. Give an example of a closure | |
2. What variables will be in scope when a closure is called? Can it see a variable defined after the function declaration? | |
3. How are closures used to manage scope? Why is this important in Javascript? | |
4. How are closures important in callbacks? What property of closures allows this? | |
5. What is function wrapping? How does closure enable this? | |
6. What is an immediate function? Give a code example (from a library, if you can). Do you know other ways that a function can be invoked immediately? | |
7. What is an immediate function good for? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment