Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 633 Bytes

5.module.md

File metadata and controls

17 lines (12 loc) · 633 Bytes

Exercises - Module 5

Tip:  
npm run test5
  1. Create a Counter factory with:

    • A private _value property initiated with 0.
    • A public getValue method.

    Initialize and assign it to a variable and make a call to getValue from outside printing the counter value;

  2. Add to Counter:

    • A private _changeValueBy method to change it's value.
    • A public increment method that calls _changeValueBy;
    • A public decrement method that calls _changeValueBy;

    Initialize two counters and make subsequent calls to increment and decrement then compare values of each counter instance;