Question about extension properties. This is the g...
# getting-started
a
Question about extension properties. This is the given example:
Copy code
val <T> List<T>.lastIndex: Int
    get() = size - 1
And this text:
Note that, since extensions do not actually insert members into classes, there's no efficient way for an extension property to have a backing field. This is why initializers are not allowed for extension properties. Their behavior can only be defined by explicitly providing getters/setters.
So if I'm reading this right, I can't actually store some value in an extension property, but rather it's a way of wrapping some custom functionality in the form of a property for convenience?