JavaScript array element to string -
i have simple array , want generate string include elements of array, example:
the array set follow:
array[0] = uri0 array[1] = uri1 array[2] = uri2
and output string must
teststring = uri0,uri1,uri2
i've tried make following way (using loop):
var teststring = ""; teststring = teststring+array[y]
but in firebug console see error message:
"teststring not defined"
i don't know, i'm doing wrong. can give me hint?
you must use join function on array:
var teststring = array.join(",");
Comments
Post a Comment