hi everyone, im looking for a better explanation of how to do this exercise, i found some questions and replays in the forum but i`d need to go one step back. This is the link to the exercies : https://www.codecademy.com/paths/front-end-engineer-career-path/tracks/fecp-22-javascript-syntax-part-ii/modules/wdcp-22-mysterious-organism/projects/mysterious-organism
i want to know hot to use de .mutate in this situation :
" Your team wants you to simulate P. aequor‘s high rate of mutation (change in its DNA).
To simulate a mutation, in pAequorFactory()‘s returned object, add the method .mutate().
.mutate() is responsible for randomly selecting a base in the object’s dna property and changing the current base to a different base. Then .mutate() will return the object’s dna.
For example, if the randomly selected base is the 1st base and it is ‘A’, the base must be changed to ‘T’, ‘C’, or ‘G’. But it cannot be ‘A’ again."
THANKS
MY CODE:
// Returns a random DNA base
const returnRandBase = () => {
const dnaBases = [‘A’, ‘T’, ‘C’, ‘G’]
return dnaBases[Math.floor(Math.random() * 4)]
}
// Returns a random single strand of DNA containing 15 bases
const mockUpStrand = () => {
const newStrand =
for (let i = 0; i < 15; i++) {
newStrand.push(returnRandBase())
}
return newStrand
}
const pAequorFactory = (specimenNum, dna) => {
return {
specimenNum : specimenNum,
dna : dna,
}
}
//console.log(pAequorFactory(1, mockUpStrand(
)));