Skip to content

Katherine Fitzpatrick - Sprint-Challenge--JavaScript - #661

Open
KatieFizzy wants to merge 8 commits into
bloominstituteoftechnology:masterfrom
KatieFizzy:master
Open

Katherine Fitzpatrick - Sprint-Challenge--JavaScript #661
KatieFizzy wants to merge 8 commits into
bloominstituteoftechnology:masterfrom
KatieFizzy:master

Conversation

@KatieFizzy

Copy link
Copy Markdown

No description provided.

@kamry-bowman kamry-bowman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on this, everything looks really good!

Nice job on frequent commits!

Comment thread Answers.md
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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Answers.md
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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is used when the function that contains the this binding is called from an object (e.g., person.talk() )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants