Mystery Organism

Hello all, I am currently working on the mysterious organism challenge and I’m coming up with a TypeError where it doesn’t seem like a type error should exist.

On line 20 where I am comparing the dna strand at index [randomNum] “This.dna[randomNum]” to the newBase, it appears that the randomly generated number is coming through as a string rather than a number. Can anyone help me see why this would be happening.

P.S. I have used a few different console.log statements to check that the newBase and randomNum variables are in fact their correct types.

UPDATE: It seems as if you do not need the this keyword when the method isn’t defined directly in the object itself. Removing the “this” keyword entirely from the code makes it function as expected.