You mutatedBase
has problems which is it can not be duplicated with the remove target base. So in this case you must check if oldBase === mutatedBase
and we have to regenerate it
in the mutate()
property, why do you have to recreate new DNA’s base?
const selectDnaBase = Math.floor(Math.random() * 15);
you have to use its own DNA by using this.dna
and mutate only 1 base in 15 bases of its DNA
Hello, this is my work and would like to know if there is any way for me to optimize the code. Mysterious Organism Project
Hi everyone! I’d like to share with you my version of this challenge, it took me some days to do that and even if I didn’t reach to complete the last compareDNA() I’d love to know what do you think of my work!
Thanks!