function pairElement(str) {
	let mainArr = [];
	for (let i = 0; i < str.length; i++) {
		switch (str[i]) {
			case "A":
				mainArr.push(["A", "T"]);
				break;
			case "T":
				mainArr.push(["T", "A"]);
				break;
			case "C":
				mainArr.push(["C", "G"]);
				break;
			case "G":
				mainArr.push(["G", "C"]);
				break;
			default:
				console.log("No matches at all");
		}
	}

	return mainArr;
}
// The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.
The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.
The character and its pair are paired up in an array and all the arrays are grouped into one encapsulating array .
function pairElement(str) {
	let mainArr = [];
	for (let i = 0; i < str.length; i++) {
		switch (str[i]) {
			case "A":
				mainArr.push(["A", "T"]);
				break;
			case "T":
				mainArr.push(["T", "A"]);
				break;
			case "C":
				mainArr.push(["C", "G"]);
				break;
			case "G":
				mainArr.push(["G", "C"]);
				break;
			default:
				console.log("No matches at all");
		}
	}
	return mainArr;
}
function pairElement ( str ) { let mainArr = [ ] ; for ( let i = 0 ; i < str . length ; i ++ ) { switch ( str [ i ] ) { case "A" : mainArr . push ( [ "A" , "T" ] ) ; break ; case "T" : mainArr . push ( [ "T" , "A" ] ) ; break ; case "C" : mainArr . push ( [ "C" , "G" ] ) ; break ; case "G" : mainArr . push ( [ "G" , "C" ] ) ; break ; default : console . log ( "No matches at all" ) ; } } return mainArr ; }
The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.
The character and its pair are paired up in an array and all the arrays are grouped into one encapsulating array .