DNA Pairing not returning the right thing?[SOLVED]

Hi guys, I don’t know what’s going on with my code. I seem to return the right thing but it doesn’t pass the challange.

function pairElement(str) {
  var array = [];
  var singleElement = str.split("");
  singleElement.forEach(function(dna){
    var temporaryArray = [];
    if(dna == "G"){
	      temporaryArray.push("G");
	      temporaryArray.push("C");
	      array.push(temporaryArray);
    } else if(dna == "C"){
	      temporaryArray.push("C");
	      temporaryArray.push("G");
	      array.push(temporaryArray);
    } else if(dna == "A"){
	      temporaryArray.push("A");
	      temporaryArray.push("T");
	      array.push(temporaryArray);
    } else if(dna == "T"){
	    temporaryArray.push("T");
	    temporaryArray.push("A");
	    array.push(temporaryArray);
    }
  });
}

pairElement("ATCGA");

Any suggestions?

Try like this,
if (dna=="G") {Array.push(["G","C"])}

Your code works except you forgot to return the array at the end. And you could have pushed an array literal directly without the need for temporaryArray like @mgjean said.

I feel so stupid now. I’m a little tired but really there’s no excuse for this. Thanks for your quick input guys!