The strange += operator in Kotlin introduce an immutable structure of the class for the plus operator which means any class outside the class can’t edit its internal data . introduce a mutable structure of the class for the plusAssign operator which means its internal data can be edited anywhere.
What does ?: Mean in Kotlin?
length ?: -1. If the expression to the left of ?: is not null , the Elvis operator returns it, otherwise it returns the expression to the right . Note that the expression on the right-hand side is evaluated only if the left-hand side is null .