配列とかおれおれAdvent Calendar2018 – 02日目 JavaScriptの配列のインスタンスを保ったまま中身を全て削除したい場合、 length に 0 を設定するだけで実現できます。 仕様 length の変更で要素が削除されることについて、配列特殊オブジェクト Array Exotic Objects の項に記載があります。 9.4.2 Array Exotic Objects … whenever the value of the length property is changed, every own property whose name is an array index whose value is not smaller than the new length is deleted. This constraint applies only to own