Skip to content

Suggestion | Safe Operator: ?= #7209

Description

@CosmoCreeper

There is a new operator in JavaScript for replacing the try...catch block. This operator is the ?= operator. You can assign two variables to it. Example use is below.

const demonstrationFunction = async () => {
    const [error, response] ?= await fetch("www.example.com");

    if (error) return console.error(error);
    return response;
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions