Skip to content

Instantly share code, notes, and snippets.

@Andyccs
Last active November 19, 2015 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andyccs/473475bbbd7697e7979c to your computer and use it in GitHub Desktop.
Save Andyccs/473475bbbd7697e7979c to your computer and use it in GitHub Desktop.
Medium post
export class Rectangle {
constructor (width, height) {
this.width = width
this.height = height
}
set width (width) { this._width = width }
get width () { return this._width }
set height (height) { this._height = height }
get height () { return this._height }
get area () { return this.width * this.height }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment