Is there a null-coalescing (Elvis) operator or safe navigation operator in javascript?

I’ll explain by example: Elvis Operator (?: ) The “Elvis operator” is a shortening of Java’s ternary operator. One instance of where this is handy is for returning a ‘sensible default’ value if an expression resolves to false or null. A simple example might look like this: def gender = user.male ? “male” : “female” … Read more