en.javascript.info/1-js/6-objects-more/7-bind/4-function-property-after-bind/task.md
2015-01-14 10:23:45 +03:00

20 lines
450 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Свойство функции после bind
[importance 5]
В свойство функции записано значение. Изменится ли оно после применения `bind`? Обоснуйте ответ.
```js
function sayHi() {
alert(this.name);
}
sayHi.test = 5;
alert(sayHi.test); // 5
*!*
var bound = sayHi.bind({ name: "Вася" });
alert(bound.test); // что выведет? почему?
*/!*
```