Guarded Declarations (const / let … else …)

Replying to myself since I can’t edit the root post.

I also didn’t find this initially when looking, but it seems someone proposed a similar concept. Try-catch oneliner - #2 by jridgewell . I think I had this in mind initially when proposing mine, but I wanted to avoid introducing new keywords like guard. But I did think about this.

1 Like