Reading this question I found a reference to the so-called Elvis operator (link in English) or ?:
which is very similar to the operator ||
used in javascript or also called the null coalescence operator (link in English).
Investigating more about both I could not distinguish any difference between them which led me to ask myself, is there really a difference? If there isn't, then why are there two references to something that semantically means the same thing?
Examples of the elvis operator
var variable = foo ?: bar
Returns foo
if foo
it exists and is not null else returnsbar
Null coalescing operator
var variable = foo || bar
which does exactly the same
Note: The elvis operator is not part of the javascript language, the ternary operator is instead .