ar circle = { radius: 10, circumference(){ var Circum = 2 * Math.PI * this.radius; return Circum.toFixed(2); // For Precision to 2 decimal point }, area(){ var Area = Math.PI * (this.radius ** 2); return Area.toFixed(2); // For Precision to 2 decimal point } };
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter