Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const shape = {
- radius: 10,
- diameter() {
- return this.radius * 2;
- },
- perimeter: () => 2 * Math.PI * this.radius
- };
- console.log(shape.diameter());
- console.log(shape.perimeter());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement