Compare commits

...

3 Commits

Author SHA1 Message Date
jason.zhu 2a5ef56d42 Module4: Using the Spread Operator 2021-05-13 15:14:05 +10:00
jason.zhu d822050bdc Module4: Constructing Rest Parameters 2021-05-13 15:03:13 +10:00
Jason Zhu 368314fcdd Module 4: What are default parameters? 2021-05-12 23:05:26 +10:00
1 changed files with 6 additions and 11 deletions

17
app.js
View File

@ -1,11 +1,6 @@
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());
function display(char1, char2, char3, char4, ...others) {
console.log(others);
console.log(char1, char2, char3, char4);
}
let letters = 'abcdefgh';
display(...letters);