DNA pairing using if else loop..plz correct any mistakes

function pairElement(str) {
  // Return each strand as an array of two elements, the original and the pair.
  var paired = [];

  // use if statement to check 
  var search = function(char) {
    if(char=='A')
    {
 paired.push(['A', 'T']);

    }
 else if(char=='T'){
     
  paired.push(['T', 'A']);
   }else if(char=='C'){
   
        paired.push(['C', 'G']);
       }
    else if  (char=='G'){
         paired.push(['G', 'C']);
       }
    };
  
  // Loops through the input and pair.
  for (var i = 0; i < str.length; i++) {
    search(str[i]);
  }

  return paired;
}
pairElement("CTCTA");

I cleaned up your code.
You need to use triple backticks to post code to the forum.
See this post for details.