My journey with TypeScript has just begun, and while working in WebStorm, the IDE suggested using a static modifier...
export default class MyClass {
public bar(): any {
// perform actions with instance values
}
private foo(a: any, b: any): any {
// perform actions without instance values, such as validation
}
}
An interesting point was brought up suggesting that foo(a, b)
could be marked as static
. I decided to ignore this suggestion for now, as I personally see excessive use of static methods as a potential red flag. However, my knowledge in TypeScript is still developing, and I may not fully understand the benefits of using the static modifier.
Are there any significant advantages or "side-benefits" associated with utilizing the static modifier? Beyond the technical definition provided in the documentation.