const foo = [1, 2, 3];
console.log(foo);  //[1, 2, 3]

// 配列のクローン
const pl1 = [...foo]; 
console.log(pl1);  //[1, 2, 3]

// 要素を追加して新しい配列を生成
const pl2 = [...foo, 3, 4];
console.log(pl2);  //[1, 2, 3, 3, 4]

// 配列をマージ
const pl3 = [...foo, ...pl1];
console.log(pl3);  //[1, 2, 3, 1, 2, 3]

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.