Assuming assert existed, it would almost certainly be judging its value for being falsy, while the ?? operator judges its LHS for being nullish, which is a narrower category. For strings, this affects whether the empty string is acceptable or not.
It's a function you could write for yourself and give it whatever semantics you feel is best. No changes to the language required for this one.
console.assert(maybeNull != null, 'variable not set')