I am currently having an issue understanding how the solution was solved this way. I looked at the solution for this code and I need someone to explain why they chose certain parameters.
Here is the following code:
compareDNA(otherOrg) {
const similarities = this.dna.reduce((acc, curr, idx, arr) => {
if (arr[idx] === otherOrg.dna[idx]) {
return acc + 1;
} else {
return acc;
}, 0);

1 Like

I also have no idea and it looks like nobody answered you. Did you ever figure this out?