logoalt Hacker News

nine_klast Monday at 3:29 AM1 replyview on HN

Why, "try and" could be like "try / finally", and "what all" could be filter().

I won't mind "await y'all" to await multiple promises.


Replies

AlienRobotlast Monday at 10:21 AM

What if...

    try {
       let x = parseInt(input);
       and {
           displayResult(x / 0);
       }
    } catch {
       displayError("Parsing error.")
    }
And the catch can't catch a division by zero error because it occurred inside an "and" block.
show 2 replies