Static Method

noun

say it: “STAT-ik METH-ud” /ˈstætɪk ˈmɛθəd/

A method marked static that belongs to the class itself, so you call it on the class name, like Recipe.fromText(text), not on one object.

What is Static Method in JavaScript?

Static Method — A class method called on the class itself rather than an instance.

class Price {
    static withTax(amount) {
        return amount * 1.08;
    }
}

In a sentence

  • “Ship.compare(a, b) is a static method: I call it on the class, not on any one ship.”

Level: Journeyman · More JavaScript terms at this level

Updated