Check out example codes for "PropertyCopy from one object to another in kotlin". It will help you in understanding the concepts better.

Code Example 1

data class Record(val name: String, ...)
...
header2 = header1.copy(name = " new_name)

Learn ReactJs, React Native from akashmittal.com