Array to string

I try to convert an array to a string with the values separated by a return.

var test = new Array("text1","text2","text3")
test.join("\n")
application.output(test);

What I want is something like:

“text1
text2
text3”

All I get is : [Ljava.lang.Object;@50d549

what am I doing wrong?

try this:

var test = new Array("text1","text2","text3")
application.output(test.join("\n"));

this works great, thank you

The join method creates and returns a string. You have not assigned this anywhere, so outputting “test” just outputs the array. Next to Harjo’s solution you could also have written this

var test = new Array(“text1”,“text2”,“text3”)
test = test.join(“\n”);
application.output(test);

Thanks Patrick, this makes things clear.