📜  数组到字符串 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:49.098000             🧑  作者: Mango

代码示例6
const elements = ['Sun', 'Earth', 'Moon'];

console.log(elements.join());
// output: "Sun,Earth,Moon"

console.log(elements.join(''));
// output: "SunEarthMoon"

console.log(elements.join('-'));
// output: "Sun-Earth-Moon"