That may be a nice addition to the "do expression" proposal for javascript: https://github.com/tc39/proposal-do-expressions
let x = do {
let tmp = f();
tmp * tmp + 1
};
Unfortunately it seems like the proposal doesn't get much attention.