Is defining properties on a function in JavaScript considered bad practice?

后端 未结 0 427
面向向阳花
面向向阳花 2021-02-05 07:25

I know that the following is valid in JavaScript:

function Rectangle(x, y, w, h) {
  this.x = x;
  this.y = y;
  this.w = w;
  this.h = h;
}

Rectangle.getRight =         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题