Skip to content

Commit b9b9796

Browse files
authored
Update README.md
1 parent 9257faa commit b9b9796

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ closureFunction('I am inside');
745745
// Inner Variable: I am inside
746746
```
747747
**Closures can be used to create private variables**
748-
748+
```
749749
function createCounter() {
750750
let count = 0; // Private variable
751751
@@ -769,6 +769,7 @@ console.log(counter.increment()); // Output: 1
769769
console.log(counter.increment()); // Output: 2
770770
console.log(counter.getCount()); // Output: 2
771771
console.log(counter.decrement()); // Output: 1
772+
```
772773

773774
**Private function example**
774775

0 commit comments

Comments
 (0)