Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions assignments/this.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* The for principles of "this";
* in your own words. explain the four principle for the "this" keyword below.
* in your own words. explain the four principles for the "this" keyword below.
*
* 1.
* 2.
* 3.
* 4.
* 1. Is the function called by new?
* 2. Is the function called by call(), apply(), or bind()?
* 3. Is the function called as a method, ie: obj.func()?
* 4. Is the function called in the global scope?
- If strict mode is enabled, return undefined.
- Otherwise, return the global object, ie: window.
*
* write out a code example of each explanation above
*/
Expand Down