Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wizard04wsu authored Mar 5, 2019
1 parent 3d8c240 commit 21dde13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ let Rectangle = Class.extend({
className:"Rectangle",
constructorFn:function (Super, width, height){
Super();
this.width = Math.abs(width||0);
this.height = Math.abs(height||0);
Object.defineProperty(this, "area", { get:function (){ return this.width * this.height; }, enumerable:true, configurable:true });
this.width = width||0;
this.height = height||0;
Object.defineProperty(this, "area", { get:function (){ return Math.abs(this.width * this.height); }, enumerable:true, configurable:true });
},
returnFn:function (width, height){
return Math.abs((width||0) * (height||0));
Expand All @@ -57,7 +57,7 @@ let Square = Rectangle.extend({
className:"Square",
constructorFn:function (Super, width){
Super(width, width);
Object.defineProperty(this, "height", { get:function (){ return this.width; }, set:function (val){ return (this.width = Math.abs(val)); }, enumerable:true, configurable:true });
Object.defineProperty(this, "height", { get:function (){ return this.width; }, set:function (val){ this.height = this.width = val; }, enumerable:true, configurable:true });
},
returnFn:function (width){
return Math.pow(width||0, 2);
Expand Down

0 comments on commit 21dde13

Please sign in to comment.