Creating and filling Arrays of arbitrary lengths in JavaScript Update 2019-01-02: Rewrote the section on performance. Switched from Array.from(new Array(LEN)) to Array.from({length: LEN}) (because the former argument can get large). New sections: “Recommended patterns”, “Acknowledgements”. The best way of creating an Array, is via a literal: const arr = [0,0,0]; Alas, that isn’t always an option,