Katherine Fitzpatrick - Sprint-Challenge--JavaScript - #661
Open
KatieFizzy wants to merge 8 commits into
Open
Conversation
kamry-bowman
left a comment
There was a problem hiding this comment.
Great job on this, everything looks really good!
Nice job on frequent commits!
| What is closure?<br> | ||
| It's a term used to describe when a function lives inside another function and can only be accessed through the function it's living in. Closure also requires the nested function is using only variables from the environment of the parent function. The practical and powerful part of closure is that even after the parent function runs and metaphorically dies, the closure (nested function + variables in environment) lives on, allowing the function and it's variables to maintain state.<br> | ||
| Describe the four rules of the 'this' keyword.<br> | ||
| 1. Window/Global Object Binding - if "this" is used while in global scope, it will bind to the window object;<br> |
There was a problem hiding this comment.
it's not about where this is used, it's about how the function with this inside it is called. If no other this binding rule applies, then it's window/default binding.
| It's a term used to describe when a function lives inside another function and can only be accessed through the function it's living in. Closure also requires the nested function is using only variables from the environment of the parent function. The practical and powerful part of closure is that even after the parent function runs and metaphorically dies, the closure (nested function + variables in environment) lives on, allowing the function and it's variables to maintain state.<br> | ||
| Describe the four rules of the 'this' keyword.<br> | ||
| 1. Window/Global Object Binding - if "this" is used while in global scope, it will bind to the window object;<br> | ||
| 2. Implicit Binding -used when referring to a property within an object, the word 'this' followed by'.' <br> |
There was a problem hiding this comment.
it is used when the function that contains the this binding is called from an object (e.g., person.talk() )
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.