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);