Skip to content

Instantly share code, notes, and snippets.

View farhang's full-sized avatar
🏠
Working from home

Farhang Darzi farhang

🏠
Working from home
View GitHub Profile
@farhang
farhang / closures-counter.js
Last active March 17, 2019 12:20
Closures - counter
function counter() {
counterValue = 0;
function increase() {
counterValue += 1;
console.log(counterValue);
}
return increase;
}
var myCounter = counter();