下面的代碼演示了JS中如何通過concat函數(shù)鏈接多個(gè)數(shù)組
<!DOCTYPE html>
<html>
<body>
<script>
var parents = ["Jani", "Tove"];
var brothers = ["Stale", "Kai Jim", "Borge"];
var children = ["Cecilie", "Lone"];
var family = parents.concat(brothers, children);
document.write(family);
</script>
</body>
</html>
上面的代碼運(yùn)行結(jié)果如下:
Jani,Tove,Stale,Kai Jim,Borge,Cecilie,Lone
更多信息請(qǐng)查看IT技術(shù)專欄