https://kotlinlang.org logo
Title
x

xun su

02/16/2023, 10:09 AM
Hi, JS has spread operator
...
, is there something like this in Kotlin?
// JavaScript needs property names
const fullName = { first: 'Henry', last: 'O\'Conner' };

const streetAddress =
        { street: 'Dog Basket', city: 'Canine Town', zipCode: 'K9T' };

const fullAddress = { …fullName, …streetAddress, planet: 'Earth' };
the code above is from this post , however it is wrote in 2019, now we have some better solution?