Tell us what’s happening:
what is wrong with my code
Your code so far
function pairElement(str) {
str = str.toUpperCase();
str = str.split("");
var placeHolderArray = [];
for (var i = 0 ; i<str.length; i++){
if(str[i]=="A"){
placeHolderArray.push(["A", "T"]);
}else if (str[i]=="T"){
placeHolderArray.push(["T", "A"]);
}else if (str[i]=="C"){
placeHolderArray.push(["C", "G"]);
}else if (str[i]=="G"){
placeHolderArray.push(["G", "C"]);}
return placeHolderArray;
}
}
pairElement("GCG");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/dna-pairing