Alternatively, you can use Array.tabulate to initialize + populate this array (so you don't need the for loop).