• + 0 comments

    If we dont use second parameter in Square, there is no need to overload parent's constructor:

    class Square extends Rectangle{
        area = function(){
            return this.w * this.w
        }
    }
    

    But I presume such magic works only in JavaScript :)