|
Answer» What do you mean by NIL-coalescing operator? It is like a OPTIONAL conditional operator like if some value is nil then output is some other values. To UNDERSTAND this we will TAKE a below example which will help you to understand the syntax for nil-coalescing operator. nil-coalescing operator(x ?? y) Here in above code if x have some value then it will return value of x but if x is nill then it will return value of y here. And it is a shortut of below condition operator code:- x!= nil ? x! :y
|