up
This commit is contained in:
parent
3defacc09d
commit
f99574f53b
178 changed files with 530 additions and 271 deletions
|
@ -0,0 +1,4 @@
|
|||
The answer: `undefined`.
|
||||
|
||||
The result of `bind` is another object. It does not have the `test` property.
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
importance: 5
|
||||
|
||||
---
|
||||
|
||||
# Function property after bind
|
||||
|
||||
There's a value in the property of a function. Will it change after `bind`? Why, elaborate?
|
||||
|
||||
```js run
|
||||
function sayHi() {
|
||||
alert( this.name );
|
||||
}
|
||||
sayHi.test = 5;
|
||||
|
||||
*!*
|
||||
let bound = sayHi.bind({
|
||||
name: "John"
|
||||
});
|
||||
|
||||
alert( bound.test ); // what will be the output? why?
|
||||
*/!*
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue