Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 330 Bytes

create-arrays.md

File metadata and controls

15 lines (10 loc) · 330 Bytes

Create Arrays

空の配列を作成するのは簡単です:

const foo:string[] = [];

あるコンテンツで事前に埋められた配列を作成するには、ES6Array.prototype.fillを使います:

const foo:string[] = new Array(3).fill('');
console.log(foo); // ['','',''];