Skip to main content

Analyzing DNA

A Learning TypeScript > Arrays 🥗 appetizer project.

Hello! You're a research biologist at the Strongly Typed Institute of Biochemistry. We've got a great task for you today: analyzing sequences of DNA to find mutations!

Don't worry, you won't have to draw on your vast experience of biochemical studies. We reduced the DNA information to arrays of single-character strings. Your task is to write TypeScript functions that take in DNA and return the differences. We'll walk you through each of the functions you need to write.


If you haven't yet, set up the repository locally.

git clone learning-typescript-projects
cd learning-typescript-projects
npm i

Change your terminal directory to this project's:

cd projects/arrays/analyzing-dna

In one terminal, start the TypeScript compiler in watch mode:

tsc --watch

In another terminal, run Jest on whichever step you're working on. For example, to run tests for the first step in watch mode:

npm test -- 1 --watch



  • Please solve these with for loops, not fancy .map/.reduce shenanigans or with npm libraries.
    • For bonus points, you can try making versions of all the steps that only use array methods instead of for loops!
  • Don't import code from one step into another.