Mysterious Organism syntax error after final line of code

Doing the mysterious organism project here: https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-javascript-syntax-part-ii/modules/fecp-challenge-project-mysterious-organism/projects/mysterious-organism
I’m on step 6 but keep getting an unexpected ) syntax error on line 52. I only have 51 lines of code.
This is my code, please help.

// 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; } const pAequorFactory = (orgNum, dnarr) => { return { specimenNum: orgNum, dna: dnarr, mutate(){ let dna2mut = Math.floor(Math.random() * dnarr.length); let tempBase = dnarr[dna2mut]; do { dnarr[dna2mut] = returnRandBase(); } while (dnarr[dna2mut] === tempBase); }, compareDNA(pAeqObj){ let sameCount = 0; for(let i in this.dna){ if(this.dna[i] == pAeqObj.dna[i]){ sameCount++; } } let samePcent = (sameCount/this.dna.length) * 100; console.log(`Specimen #${this.specimenNum} and specimen #${pAeqObj.specimenNum} have ${samePcent}% DNA in common.`); }, willLikelySurvive(){ let cGBases = 0; for (let item in this.dna) { if(dna[item] === "C"){cGBases ++;} else if(dna[item] === "G"){cGBases ++;} } return (cGBases/this.dna.length) * 100 >= 60 ? true : false; } } const org01 = pAequorFactory(01,mockUpStrand()); const org02 = pAequorFactory(02,mockUpStrand()); console.log(org01.willLikelySurvive()); //console.log(org02); //org01.compareDNA(org02);

Hey there and welcome to the community!! :slightly_smiling_face:

“Unexpected end of input” typically means the compiler/interpreter is needing something in order to finish its job. The most common thing would be a closing bracket. I’d check your closing brackets and see if they match up to your opening brackets.

got it I was missing a curly bracket to close out my function thanks :sweat_smile:

1 Like