Extension Functions vs. Member Functions
Explore the key differences between extension functions and member functions.
Members and multiplicity
The biggest difference between members and extensions in terms of use is that extensions need to be imported separately. For this reason, they can be located in a different package. This fact is used when we cannot add a member ourselves. It is also used in projects designed to separate data and behavior. Properties with fields need to be located in a class, but methods can be ...