I am new to learning objects and classes in Javascript. I was just wondering, why would you attach a static method to a class, like so:
class MyClass {
static myFunction(){
console.log('foo');
}
}
When you can just declare a regular, custom function outside of the class like one usually does?
function myFunction() {
console.log('foo');
}