function Rectangle_area() { return this.width * this.height; } function Rectangle(w,h) { this.width = w; this.height = h; this.area = Rectangle_area; } field = new Rectangle(2,4); fieldarea = field.area();