Skip to content

Instantly share code, notes, and snippets.

@heapwolf heapwolf/12.js
Created Jul 19, 2012

Embed
What would you like to do?
modules/pi-obj
var pi = Math.PI;
module.exports = function(radius) {
function diameter() {
return2 * radius;
}
function circumference() {
return pi * diameter();
}
function area() {
return pi * Math.pow(radius, 2);
}
return {
area: area,
circumference: circumference
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.