How to append or concat strings in Javascript?
问题 So I'm trying to add to a string and it shows up as empty. var DNA = "TAG"; var mRNA = ""; m_RNA() function check(a, b, string) { if (string = a) { mRNA.concat(b); } } function m_RNA(){ //console.log(DNA) for (var i = 0; i < DNA.length; i++) { console.log("Checking: " + DNA[i]); check("T", "A", DNA[i]); check("A", "U", DNA[i]); check("C", "G", DNA[i]); check("G", "C", DNA[i]); console.log(mRNA); } } Its supposed to show AUC in the console but its just blank. This is through firefox by the way