Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 838 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 838 Bytes

Practice: Making Code DRY

In this practice, you will use the DRY principle to abstract a pattern into a helper function.

Set Up

Clone the practice from the starter.

Run npm install to install all dependencies.

Directions

You will find four functions in the file practice.js. If you run npm test now, you should see all the specs testing those four functions passing. Your job is to look at the four functions and identify where you may be able to refactor by creating a single helper function that is used in all four functions to help DRY this code.

When you are sure that you have successfully refactored the code, run npm test to see if the functions still return the correct information by making sure all the test specs still pass.