There are many ways one can declare a function in javascript. One of the ways is declaring a class and a static function inside is as showed below.
class className {
static fucntionName() {
}
}
another way of is declaring is through the tradition javascript style as showed below.
function functionName() {
}
I would like to know the advantages/disadvantages of using either of the cases. Is there any specific use cases for the static methods, why declare a class(we know that in javascript there is no need to instantiate the class in order to access the static function). Why not just use the traditional way (the second case in the above example) of function declaration in all/any use case?
I would like to understand this is in detail.