DNA pairing help

So I managed to get to this part relatively easy and all the answers check out my guess is my mistake is that when I test it although it has the proper values it isn’t in double quotation marks. any help on this would be very much appreciated

  **My code so far**

function pairElement(str) {
let dnastr = Array.from(str);
let dnapairs = [];
for(let i = 0; i < dnastr.length; i++){
  if (dnastr[i] === 'C')
  {
    dnapairs.push(["C","G"]);
  }
  if (dnastr[i] === 'G')
  {
    dnapairs.push(["G","C"]);
  }
  if (dnastr[i] === 'A')
  {
    dnapairs.push(["A","T"]);
  }
  if (dnastr[i] === "T")
  {
    dnapairs.push(["T","A"]);
  }
};

console.log(dnapairs)
return dnastr;

}



pairElement("ATCGA");
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36

Challenge: DNA Pairing

Link to the challenge:

It should have been return dnapairs and not dnastr . :slight_smile:

i didn’t want to look at any hints or anything yet so wanted outside hints as to why this isn’t working and not a straight-up answer, please.

Lol thanks a ton, you’re a star I wasn’t paying attention because I was using console log to try and debug.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.