Skip to content

Comment on Safe Assignment

Comments

I don't think we'll ever see this. At least I hope we won't. Even specifying its behavior seems to be a nightmare. And you can basically just write it yourself.

    [val, err] ?= maybeThrow(); // instead of this
    [val, err] = wrapErr(maybeThrow); // you can write wrapErr yourself and use it forever
    [val, err] = wrapErr(maybeThrow, arg1, arg2); // you can even provide args
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.