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