Compare commits
No commits in common. "master" and "Module3_Changing_Functions_Context_and_Built-in_Functions" have entirely different histories.
master
...
Module3_Ch
17
app.js
17
app.js
@ -1,6 +1,11 @@
|
||||
function display(char1, char2, char3, char4, ...others) {
|
||||
console.log(others);
|
||||
console.log(char1, char2, char3, char4);
|
||||
}
|
||||
let letters = 'abcdefgh';
|
||||
display(...letters);
|
||||
let person1 = {
|
||||
name: 'Mary',
|
||||
getName: function(){
|
||||
return this.name;
|
||||
}
|
||||
};
|
||||
let person2 = {
|
||||
name: 'John'
|
||||
};
|
||||
let getNameCopy = person1.getName.bind(person2); // won't change context of function
|
||||
console.log(getNameCopy());
|
Loading…
x
Reference in New Issue
Block a user