-
-
Save opr/439d0db1bfda5af9bacfb18c729ab898 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calculateSurfaceArea(dimensions) { | |
let sides = [2 * (dimensions[0] * dimensions[1] ), 2 * (dimensions[1] * dimensions[2]), 2 * (dimensions[0] * dimensions[2] )]; | |
return sides[0] + sides[1] + sides[2]; | |
} | |
And the calculateVolume function looks like this | |
function calculateVolume(dimensions) { | |
return dimensions[0] * dimensions[1] * dimensions[2]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment