Mysterious Organism - compareDNA() works, but returns undefined

Link to project

Here is 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 stand of DNA containing 15 bases
const mockUpStrand = () => {
const newStrand = ;
for (let i = 0; i < 15; i++) {
newStrand.push(returnRandBase());
}
return newStrand;
};
//created a nextId to automatically assign unique id
let nextId = 0;

//factory function
const pAequorFactory = (dnaArr) => {
nextId++;
return {
specimenNum: nextId,
dna: dnaArr,
mutate() {
let randomNum = Math.floor(Math.random() * this.dna.length);
let randomBase = this.dna[randomNum];
let newBases = [‘A’, ‘T’, ‘C’, ‘G’].filter(base => base !== randomBase);
randomBase = newBases[Math.floor(Math.random() * newBases.length)];
this.dna[randomNum] = randomBase;
return this.dna;
},

//compareDNA method
compareDNA(otherpAequor) {
  let identicalDNA = 0;
  for (let i=0; i<this.dna.length; i++) {
    if (this.dna[i] === otherpAequor.dna[i]) {
      identicalDNA++;
    }
  }
  let percentageMatch = identicalDNA / this.dna.length * 100;
  console.log(`Specimen ${this.specimenNum} and Specimen ${otherpAequor.specimenNum} have ${percentageMatch}% DNA in common`);
},

//willLikelySurvive method
willLikelySurvive() {
  let survivalBases = 0;
  this.dna.forEach(base => {
    if (base === 'C' || base === 'G') {
      survivalBases++;
    } else {
      survivalBases;
    }
  });
  if (survivalBases / this.dna.length >= 0.6) {
    return true;
  } else {
    return false;
  }
}

};
};

//array to store organisms
const organismArr = ;

//function to create any number of organisms
const create = num => {
for (let i=0; i<num; i++) {
organismArr.push(pAequorFactory(mockUpStrand()));
}
};

//create 30 organisms
create(30);

//test compareDNA()
organismArr[2].compareDNA(organismArr[4]);

//logs message to console, but if typed into console, also returns “undefined”

Everything seems to be working fine, but the compareDNA() method returns “undefined” after the correct result is logged.

What have I done wrong?

Thank you in advance.

What do you expect it to return? Since there is no return in it, the default value is returned, which is undefined. In JS, if a function exits without reaching a return, undefined is always implicitly returned.