Swift

[ Swift ] Grammar

박빅백 2020. 11. 4. 13:40

??

Double question mark is a nil-coalescing operator.

In plain terms, it is just a shorthand for saying

!= nil

First it checks if the return value is nil,

if it is indeed nil, then the left value is presented,

and if it is nil then the right value is presented.