From a0720187cbe5013e58d621570aa00d74ec43e4ec Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 7 Sep 2019 17:39:32 +0300 Subject: [PATCH] fixes --- 1-js/05-data-types/05-array-methods/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/05-array-methods/article.md b/1-js/05-data-types/05-array-methods/article.md index 86c32bb3..b144d4ee 100644 --- a/1-js/05-data-types/05-array-methods/article.md +++ b/1-js/05-data-types/05-array-methods/article.md @@ -685,7 +685,7 @@ alert(soldiers[1].age); // 23 If in the example above we used `users.filter(army.canJoin)`, then `army.canJoin` would be called as a standalone function, with `this=undefined`, thus leading to an instant error. -That said, a call `users.filter(user => army.canJoin(user))` also guarantees the correct `this`, and it's more obvious what's going on, so in practice the arrow function is used most of time, instead of `thisArg`. +A call to `users.filter(army.canJoin, army)` can be replaced with `users.filter(user => army.canJoin(user))`, that does the same. The former is used more often, as it's a bit easier to understand for most people. ## Summary