Hi Everyone, I’ve been looking and looking at this and I’m no longer being productive. The code is throwing an syntax error on the line for (let percent = matchCount / 15 * 100) {
saying:
SyntaxError: Unexpected token )
What am I not seeing?
compareDNA(specimen) {
let zip = [];
let array1 = this.dna;
let array2 = specimen.dna;
let matchCount = 0
for (let i = 0; i < array1.length; i++) {
zip.push([array1[i], array2[i]]);
} return zip;
if (array1[i] === array2[i]) {
matchCount++;
}
for (let percent = matchCount / 15 * 100) {
percent.toFixed();
} console.log('Specimen ' + this.specimenNum + ' and specimen ' + this.specimenNum ' have ' + percent + ' percent DNA in common.');
}
}
},
org1 = (pAequorFactory(1, mockUpStrand()));
org2 = (pAequorFactory(2, mockUpStrand()));
console.log(org1.compareDNA(org2));