Instructions

Read about private fields in classes here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

  1. Open the terminal and run npm install. Because this project is dependent upon a testing framework, you will need to install the dependencies before you can run the tests.
  2. Try running the tests by running npm test. You should see a failing test.

Complete the following steps to make the test pass:

Be sure to read the failing tests by running npm test to understand what is being asked of you. Run the tests after each step to make sure you are on the right track.

  1. In your Person class, introduce a private field named #id that gets a random value when an object is instantiated.
  2. Create a getter method to retrieve this ID value.
  3. Instantiate a Person object and try accessing the ID directly and via the getter. Document your observations.