console.log([...[3, 2, 1]].join("-")); var a = [3, 2, 1]; console.log([...a].join("-"));