Fix issue with example code
Adjust initCounter's returned reset method to fit the idea it's trying to illustrate, of resetting the counter value
This commit is contained in:
@ -35,7 +35,7 @@ const initCounter = (start = 0) => {
|
||||
get: () => value,
|
||||
increment: () => ++value,
|
||||
decrement: () => --value,
|
||||
reset: () => start
|
||||
reset: () => value = start
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user