Compare commits

..

No commits in common. "master" and "module1_writing_modular_code_with_functions" have entirely different histories.

16
app.js
View File

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