Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function counter() {
- counterValue = 0;
- function increase() {
- counterValue += 1;
- console.log(counterValue);
- }
- return increase;
- }
- var myCounter = counter();
- myCounter();
- myCounter();
- myCounter();
- myCounter();
- myCounter();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement