Hello - Javascript has the || operator which can be used to evaluate nulls. For example:
var val = myobj.myprop || 'defaultval'
If myobj.myprop is null then val will be set to 'defaultval'. This behavior is referred to as "coalesce" in sql server (using the coalesce keyword) as well as .NET (using the ?? operator).
Is this behavior also referred to as "coalesce" in js using the || operator - or just plain old "or" but in a different context?
Also - has the || operator always been available as a coalesce operator in js or was this functionality introduced in a later release of the core language?
Also, is there any performance advantage to using the || operator instead of the ternary operator in js to evaluate nulls (even if the performance advantage is miniscule)? If there is then please explain why if you know the reason. Thanks!