what is the use of javascript static methods on classes
// Classes : static methods in javascript classes
class Square {
constructor(width){
this.width = width ;
this.height = width ;
}
static equals(a , b){
return a.width * a.height === b.width * b.height ;
}
static validDimensions(width , height ){
return width === height ;
}
}
console.log(Square.validDimensions(8 , 8));
console.log(Square.validDimensions(10 , 12));
console.log(Square.validDimensions(0 ,0 ));
console.log(Square.validDimensions(2 , 3));
console.log(Square.validDimensions(-3 , -3));