Last Updated: February 25, 2016
·
223
· kubio

JavaScript で 配列を空にする


var arr = ['aaa', 'bbb', 'ccc'];

console.log(arr); //=>['aaa', 'bbb', 'ccc']

arr.length = 0;

console.log(arr); //=>[]
</pre>