Skip to content

Optional chaining for extensions -- ?:: #16

Description

@andyearnshaw

It would be great if optional chaining was baked into the proposal:

document.querySelector("#myElement")?::let(it => {
  // it's safe to do things with the element here
  setupInteractivity(it);
});

Equivalent to:

let temp = document.querySelector("#myElement");
if (temp != null) {
    setupInteractivity(temp);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions