For example in PHP, it works exactly like you describe.
You can write x ?? y
Which is x !== null and x != undefined ? x : y