I am attempting to print out several parts of an array as a string. However when I do print out the string, there are spaces before the commas which is giving me some trouble.
Here is some example code:
var Arr = [];
var foo = "Hello";
var voo = "World";
if (foo != null) {
Arr.push(foo);
}
if (voo != null) {
Arr.push(voo);
}
console.log(Arr.join(', '));
How can one print out said string without the spaces before the commas?
EDIT: I should clarify that in my actual code, I am pushing values from a tab-delimited text file into an array.