I have an array named res2 looks like below
[ ' sh', '1119', '' ]
res2.join();
[ ' sh', '1119', '' ]
Array.prototype.join()
will not mutate the original array, but it will return a new string:
var res2 = [ ' sh', '1119', '' ];
var result = res2.join(); //" sh,1119,"
//res2 is still the array