Understanding Methods vs. Properties in Swift
Ever wonder why data has parenthesis at the end of it? When first learning programming, I quickly learned that parenthesis indicate some sort of function was happening. Later, I learned about methods - which are functions defined in that class, such as array.map(). As I began to work with different problems, I noticed that different "functionalities" were happening without the parenthesis such as array.count. Why is this? Come to find out, data types also have properties! I knew this already but didn't make the connection until looking further into it. The properties were accessing a value and not performing a function. Phew, there is hope.
Method: array.map() array.reversed()
Properties: array.count, array.first, array.last