Skip to content

Commit

Permalink
Fix the inclusion of undeclared obj in soft bind
Browse files Browse the repository at this point in the history
  • Loading branch information
lakbychance authored Jun 4, 2021
1 parent 2a365de commit 0a87512
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions challenges/functions-challenges.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ function softBind(fn, context) {
var allArgs = fnArgs.concat(Array.prototype.slice.call(arguments));

// override the context to incoming context if it is not undefined, null or window
var context = (!this || this === window) ? obj : this;
fn.apply(context, allArgs);
var finalContext = (!this || this === window) ? context : this;
fn.apply(finalContext, allArgs);
};
}
```
Expand Down

0 comments on commit 0a87512

Please sign in to comment.