Skip to content

Finished this - #1

Open
kevlpz wants to merge 1 commit into
masterfrom
kevin-lopez
Open

kevlpz wants to merge 1 commit into
masterfrom
kevin-lopez

Conversation

@kevlpz

@kevlpz kevlpz commented Jun 12, 2019

Copy link
Copy Markdown
Owner

No description provided.

@kevlpz
kevlpz requested a review from ayunas June 12, 2019 22:57

@ayunas ayunas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good job @thehaunted using this. looks like you have a good understanding.

It looks like you haven't touched the prototype file. I'll go ahead and request changes from you to finish working out the prototypes file, and then request for my review when you finish that.

Comment thread assignments/this.js
* 2.
* 3.
* 4.
* 1. When outside of a function, 'this' refers to the window object.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

also, when used in a function, this refers to the window object.

Comment thread assignments/this.js
* 1. When outside of a function, 'this' refers to the window object.
* 2. The object before the dot on methods is what 'this' refers to.
* 3. When 'new' is used to create a new object, 'this' refers to that object.
* 4. When using '.call' or '.apply', 'this' must be explicitly defined.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

using .call / .apply , the first argument is object you want to set THIS equal to. in the case of constructor functions, when we do a .call(this), that is referring to the hidden object created by the new keyword.

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