Medium
What's unexpected about this closure behavior?
1function createCounter() {2 let count = 0;34 const counter = {5 increase() {6 count++;7 },8 decrease() {9 count--;10 },11 getCount: () => count12 };1314 Object.defineProperty(counter, 'count', {15 get: () => count,16 set(value) {17 if (typeof value === 'number') {18 count = value;19 }20 },21 configurable: false22 });2324 return counter;25}2627const counter1 = createCounter();28const counter2 = createCounter();2930counter1.increase();31counter2.count = 5;32counter1.decrease();33console.log(counter1.count, counter2.getCount());