From 0a875120b433a1c967c23af5d3621cde12add758 Mon Sep 17 00:00:00 2001 From: Lakshya Thakur Date: Sat, 5 Jun 2021 00:11:03 +0530 Subject: [PATCH] Fix the inclusion of undeclared obj in soft bind --- challenges/functions-challenges.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/functions-challenges.md b/challenges/functions-challenges.md index 5abee37..f58069a 100644 --- a/challenges/functions-challenges.md +++ b/challenges/functions-challenges.md @@ -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); }; } ```