Top "Null-coalescing-operator" questions

The null-coalescing operator (?? in PHP 7) is used to define a default value for nullable value types or reference types.

What do two question marks together mean in C#?

Ran across this line of code: FormsAuth = formsAuth ?? new FormsAuthenticationWrapper(); What do the two question marks mean, is it some …

c# null-coalescing-operator
Is there a "null coalescing" operator in JavaScript?

Is there a null coalescing operator in Javascript? For example, in C#, I can do this: String someString = null; var …

javascript operators null-coalescing-operator null-coalescing
PHP ternary operator vs null coalescing operator

Can someone explain the differences between ternary operator shorthand (?:) and null coalescing operator (??) in PHP? When do they behave differently …

php php-7 ternary-operator null-coalescing-operator
Is there a Python equivalent of the C# null-coalescing operator?

In C# there's a null-coalescing operator (written as ??) that allows for easy (short) null checking during assignment: string s = null; …

python null-coalescing-operator
is there a Java equivalent to null coalescing operator (??) in C#?

Is it possible to do something similar to the following code in Java int y = x ?? -1; More about ??

java c# equivalent null-coalescing-operator
?? Coalesce for empty string?

Something I find myself doing more and more is checking a string for empty (as in "" or null) and a …

c# string coalesce null-coalescing-operator
Unique ways to use the null coalescing operator

I know the standard way of using the null coalescing operator in C# is to set default values. string nobody = …

c# coding-style null conditional-operator null-coalescing-operator
What does a double question mark do in C#?

Possible Duplicates: ?? Null Coalescing Operator --> What does coalescing mean? What do two question marks together mean in C#? …

c# null-coalescing-operator null-coalescing
Double question marks ('??') vs if when assigning same var

Referring to the following SE answer. When writing A = A ?? B; it is the same as if( null != A ) A = …

c# compiler-optimization null-coalescing-operator