Exponentiation
EasyAcc. 96.2%
+25 XP 8
Cubic Volume
Calculating powers is streamlined in modern JavaScript with the Exponentiation (**) operator.
- Calculate the volume of a cube where the side length is
side. - Formula: volume = side³.
- Return the string: "cube volume is [volume]".
01EXAMPLE 1
Input
side = 3Output
"cube volume is 27"Explanation: 3 ** 3 = 27.
Constraints
- Use the ** operator.
- Follow exact string casing.
FundamentalsMathOperators
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
side3
Expected Output
cube volume is 27
Click RUN to test your solution