Programmatically generating a String is best accomplished with a StringBuffer. A StringBuffer doesn't generate a new String object until toString() is called.
var sb = new StringBuffer();
sb.write("Use a StringBuffer");
sb.writeAll(["for ", "efficient ", "stri...