Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

🧭 Guide to week 4 exercises

🧰 Setup

You will need to setup for this week's exercises. Use the prep from this week to install Jest. Note: You must install Jest in the root of this repo.

πŸ”§ Rewrite

console.log is most often used as a debugging tool. We use to inspect the state of our program during runtime. We can use console.assert to write assertions: however, it is not very effective for writing large test suites.

Your first task is to rewrite the assertions from week-3/implement using Jest syntax. You will also need to update the filenames in week-3/implement so they have a .test.js extension and not just a .js extension. Keep running npm test to check the new tests you've created.

πŸ” Investigate

In this exercise, you'll need to play computer with the function find. This function makes use of a while loop statement. Your task will be to step through the code to figure out what is happening when the computer executes the code.

πŸ”§ Implement

In the implement directory you've got a number of functions you'll need to implement. For each function, you also have a number of different cases you'll need to check for your function.

Use the acceptance criteria as an aid in writing tests to check your functionality.

Recommended order:

  1. get-ordinal-number.test.js
  2. count.test.js
  3. repeat.test.js
  4. is-prime.test.js

πŸ’ͺ Stretch

Try implementing the functions specified in password-validator.js and card-validator.md