Skip to content

Instantly share code, notes, and snippets.

@2012mjm
Created July 26, 2019 12:42
Show Gist options
  • Select an option

  • Save 2012mjm/7e238564c99c802f92e1b442fa927ef2 to your computer and use it in GitHub Desktop.

Select an option

Save 2012mjm/7e238564c99c802f92e1b442fa927ef2 to your computer and use it in GitHub Desktop.
const shape = {
radius: 10,
diameter() {
return this.radius * 2;
},
perimeter: () => 2 * Math.PI * this.radius
};
console.log(shape.diameter());
console.log(shape.perimeter());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment