Static Method

by REPLY2SAGAR

JavaScript

class Helper {
    static log(message) {
        console.log('LOG:', message);
    }
}

// Calling a static method
Helper.log('This is a static method.');  // Outputs: LOG: This is a static method.