beautify 1st part of the tutorial
This commit is contained in:
parent
e3dd2cedc0
commit
6444024a9d
327 changed files with 2358 additions and 1986 deletions
|
@ -5,16 +5,18 @@
|
|||
В свойство функции записано значение. Изменится ли оно после применения `bind`? Обоснуйте ответ.
|
||||
|
||||
```js
|
||||
function sayHi() {
|
||||
alert(this.name);
|
||||
function sayHi() {
|
||||
alert( this.name );
|
||||
}
|
||||
sayHi.test = 5;
|
||||
alert(sayHi.test); // 5
|
||||
alert( sayHi.test ); // 5
|
||||
|
||||
*!*
|
||||
var bound = sayHi.bind({ name: "Вася" });
|
||||
var bound = sayHi.bind({
|
||||
name: "Вася"
|
||||
});
|
||||
|
||||
alert(bound.test); // что выведет? почему?
|
||||
alert( bound.test ); // что выведет? почему?
|
||||
*/!*
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue