DNA Pairing Idk the problem

Tell us what’s happening:
Ey! how are you?
I need some help, i do not really know what’s wrong with this code :confused: Can you help me? Thanks!
Happy Coding!

Your code so far


function pairElement(str) {
  let final = [];
  final= Array.from(str).map(function(x)  
    { let template= [];
      switch (x){
        case "G":
            template.push(["G","C"]);
            break;
        case "C":
            template.push(["C","G"]);
            break;
        case "A":
            template.push(["A","T"]);
            break;
        case "T":
            template.push(["T","A"]);
            break;
      }
      return template;
    });
    return final;
}
pairElement("GCG");
console.log(pairElement("GCG"));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/dna-pairing/

The solution check is not recognizing your numbers because you have nested too many times in brackets. Each pair of letters is double-nested. Hopefully that helps.

Thank you, you are great.! That was the problem. Happy coding

1 Like

mark down with the green check box :3 so that other will know it is solluted

sorry my fault, Marked :3