I am currently writing a large amount of code, but I will keep it simple. I have a javascript array (possibly an object, still unsure exactly of the conventional naming), here is the initialization code:
var myArray = ["assignS" , ";" , "S"]
This is what I get as a console.log() from firebug on the element. There is too much code to post as it is assigned multiple values through many for loops. So this array (or object) is printed later as follows:
document.write("S -> " + myArray);
output:
S -> assignS,;,S
I do not want these commas in the result, it poses problems as some elements in the array may be commas themselves. I have ruled out the .join() method because of this, and am unsure how to proceed.
joinmethod? That seems like the logical solution.document.writecan be a very bad practice, and generally array is not expected to treat as a string. Anyway, what is your expected result? Because["assignS",";","S"].join("")returns"assignS;S".;is your preferred glue, so:["assignS", "S"].join(';')would work as well. Also before ruling something out, read the docs carefully.