Compare commits

..

8 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
368314fcdd Module 4: What are default parameters? 2021-05-12 23:05:26 +10:00
jason.zhu
2ad7483250 Module3: What is bind method? 2021-05-12 17:02:11 +10:00
jason.zhu
6a0a672e35 What is the apply Method? 2021-05-12 13:48:15 +10:00
jason.zhu
0c245858e6 Module3: What is the call Method? 2021-05-12 13:36:32 +10:00
jason.zhu
e6874571ca Module2: Demo using this keyword 2021-05-12 12:24:02 +10:00
jason.zhu
a3c7a49770 Module2: Demo add 2 numbers 2021-05-12 12:11:47 +10:00

16
app.js
View File

@ -1,12 +1,6 @@
function setupCounter(val) {
return function counter() {
return val++;
}
function display(char1, char2, char3, char4, ...others) {
console.log(others);
console.log(char1, char2, char3, char4);
}
let counter1 = setupCounter(0);
console.log(counter1());
console.log(counter1());
let counter2 = setupCounter(10);
console.log(counter2());
console.log(counter2());
let letters = 'abcdefgh';
display(...letters);