There are drafts and proposals, which will do exactly what you wanted to do. It's called Safe Assignment Operator (?=).
The syntax would be:
const t ?= someFunc() || somethingElse;
or
const [error, t] ?= someFunct();
See: dev.to - Effortless Error Handling in JavaScript: How the Safe Assignment Operator Simplifies Your Code or Medium - JavaScript Safe Assignment Operator (?=): A Complete Guide
And there is a similar package you can already use: https://www.npmjs.com/package/with-error
Follow their progress. I am also looking forward to it :)