I saw this in my generated GSP pages. What does the ? mean?
the safe navigation operator (?.) returns null if the object on the left is null, otherwise it returns the value of the right member of that object. so phoneInstance?.name
is just shorthandn for phoneInstance == null ? null : phoneInstance.name
for example:
a = x?.y
is just shorthand for:
a = (x == null ? null : x.y)
which is shorthand for:
if(x == null){
a = null
} else {
a = x.y
}