class Rectangle {
static area(a, b) {
return a * b;
}
static perimeter(a, b) {
return (a + b) * 2;
}
}
let a = 2;
let b = 6;
console.log('area: ' + Rectangle.area(a, b));
console.log('perimeter: ' + Rectangle.perimeter(a, b));
Output
area: 12
perimeter: 16