Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var input = [ {
- radius: 2,
- height: 4
- }, {
- radius: 5,
- height: 8
- }, {
- radius: 12,
- height: 3
- }
- ];
- function calcCylinder(value) {
- var volume = Math.PI * value.radius * value.radius * value.height;
- console.log(volume.toFixed(3));
- }
- input.forEach(calcCylinder);
Advertisement
Add Comment
Please, Sign In to add comment