Method

A function that belongs to a class, called on an object with a dot.

What is Method in JavaScript?

Method — A function that belongs to a class, called on an object with a dot.

const order = {
    quantity: 2,
    describe() {
        return `${this.quantity} items`;
    }
};

Level: Apprentice · More JavaScript terms at this level

Updated

In other subjects