Posted on 28th April 2025|54 views
How to use the Elvis operator?
Posted on 28th April 2025| views
The Elvis operator receives two inputs and returns the very first argument only if it is no-null, else it will return the second argument. The Elvis operators syntax is:
Fun elvisEx(arg : String){
Val value = arg : “”
}
The primary advantage of Elvis operator is we can use it for conjunction including the safe call operator.