JavaScript Classes in 2026: Methods vs Functions
Updated on December 28, 2025 5 minutes read
They offer a similar syntax and organization, but JavaScript still uses prototypes underneath. In practice, you get class-style structure with prototype-based behavior.
Instance methods are called on objects you create with new (for example, user.greet()). Static methods are called on the class itself (for example, User.fromJSON(...)) and don’t require an instance first.
This depends on how a function is called. If you extract a method into a variable and call it without an object, it loses its original context. Use obj.method(), .bind(obj), or wrap it in an arrow function to keep the right this.