From b9c84126e9557961abe2c8608fcd5bee7dd4e422 Mon Sep 17 00:00:00 2001 From: "Chuck C. Chao" Date: Tue, 19 Feb 2019 10:12:45 -0600 Subject: [PATCH] [JS] Update "Explain Function.prototype.bind" part (#166) Denoted "this" as code by using double tick mark --- questions/javascript-questions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/questions/javascript-questions.md b/questions/javascript-questions.md index 74aa415bf..fd1e19aba 100644 --- a/questions/javascript-questions.md +++ b/questions/javascript-questions.md @@ -347,7 +347,7 @@ console.log(add.apply(null, [1, 2])); // 3 Taken word-for-word from [MDN](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind): -> The `bind()` method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. +> The `bind()` method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. In my experience, it is most useful for binding the value of `this` in methods of classes that you want to pass into other functions. This is frequently done in React components.