complementary dna code example
Example: complementary dna
function DNAStrand(dna) {
const arrayDNA = dna.split("");
let complementaryDNA = "";
arrayDNA.forEach((base) => {
if (base === "A") complementaryDNA += "T";
if (base === "T") complementaryDNA += "A";
if (base === "C") complementaryDNA += "G";
if (base === "G") complementaryDNA += "C";
});
return complementaryDNA;
}