Creating arrays

Creating an empty array is super easy:

  1. const foo:string[] = [];

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

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