Home / Market / JavaScript

JavaScript

Use this skill for JavaScript implementation, refactoring, debugging, or review when you need strong Java-style OOP conventions, ES2025+ standard features, t...

skill★ 00 dlclawhubMIT-0Install in CosmosUpstream Source

Documentation & Preview

Accessors

Example

class InvoiceDraft {

    #status = "NEW";

    markSubmitted() {
        if (this.#status !== "NEW") {
          throw new Error("Only new drafts can be submitted");
        }
        
        this.#status = "SUBMITTED";
    }

    get isSubmitted() {
        return this.#status === "SUBMITTED";
    }
}

End Check