The Mysterious Organism named P. aequor is a fictional creature that is comprised of only 15 DNA bases. 4 base types (A, T, C, and G) make up a DNA strand, and each P. aequor's strand is randomised.
A factory function is used here to return the specimen number and its DNA strand. The factory function contains three methods; one mutates a single base of the DNA strand, another compares the DNA similarity of two P. aequor specimens, and the final method calculates whether the specimen is likely to survive.
A while loop is used to create 30 instances of specimens likely to survive, storing each DNA strand in an array.
- Using factory functions to create multiple objects/instances
- Methods that mutate, compare, and filter array items
- The parseFloat() function and toFixed() method
- While loops
Please note that in each project, the first commit is always the starter code provided by Codecademy.