SyntaxFix
Write A Post
Hire A Developer
Questions
In concept of immutable data, maybe this is a better way:
class TempClass { val list: List<Int> by lazy { listOf<Int>() } fun doSomething() { list += 10 list -= 10 } }