function main() { var cost = [1, 2, 3]; var _g = []; for (x in cost) _g.push("" + x); _g.join(" "); }