Skip to content

Latest commit

History

History
14 lines (10 loc) 路 282 Bytes

create-arrays.md

File metadata and controls

14 lines (10 loc) 路 282 Bytes

Creating arrays

Creating an empty array is super easy:

const foo:string[] = [];

If you want to create an array pre-filled with some content use the ES6 Array.prototype.fill:

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