While researching how to declare arrays of types online, I came across the following example:
arrayVar: Array<Type>
Seems simple enough, so I attempted to declare my variable like this:
transactions: Transactions = { total : 0, list: Array<Transaction>};
However, this resulted in a syntax error. After some trial and error, I ended up using this instead:
transactions: Transactions = { total : 0, list: Array<Transaction>()};
This solution compiles and functions as expected. Now, my question is: what is the purpose of the parentheses, and why does the declaration not work without them?