Module2: Demo add 2 numbers
parent
c38c66a446
commit
a3c7a49770
14
app.js
14
app.js
|
@ -1,12 +1,4 @@
|
|||
function setupCounter(val) {
|
||||
return function counter() {
|
||||
return val++;
|
||||
}
|
||||
}
|
||||
let sum2 = (num1, num2) => num1 + num2;
|
||||
|
||||
let counter1 = setupCounter(0);
|
||||
console.log(counter1());
|
||||
console.log(counter1());
|
||||
let counter2 = setupCounter(10);
|
||||
console.log(counter2());
|
||||
console.log(counter2());
|
||||
let output = sum2(10,5);
|
||||
console.log(output);
|
Loading…
Reference in New Issue