Best way to write that ````fun User.update(userUpd...
# getting-started
f
Best way to write that
Copy code
`fun User.update(userUpdate: User) {
    when {
        userUpdate.firstName != null -> this.firstName = userUpdate.firstName
        userUpdate.lastName != null -> this.lastName = userUpdate.lastName
        userUpdate.gender != null -> this.gender = userUpdate.gender
        userUpdate.type != null -> this.type = userUpdate.type
        userUpdate.picture != null -> this.picture = userUpdate.picture
        userUpdate.locale != null -> this.locale = userUpdate.locale
        userUpdate.heart != null -> this.heart = userUpdate.heart
        userUpdate.level != null -> this.level = userUpdate.level
        userUpdate.timezone != null -> this.timezone = userUpdate.timezone
    }
}
`