The Power Plant
Medium+20 XP
Mission Briefing
A solar flare knocked out the Math module! The shield generators need power calculations instantly, and you must rapidly recreate the exponent engine from scratch using raw iteration.
The Concept: Looping Logic
Exponentiation (like 2 to the power of 3) is just multiplying a base number by itself a specific number of times. This is the exact definition of a loop!
The Objective
Your function receives a base and an exp (exponent).
- Return the result of raising
baseto the power ofexp. - Do not use
Math.pow()or the**operator. You must use a loop to repeatedly multiply an accumulator. - Example: base 2, exp 3 ->
2 * 2 * 2 = 8.
Constraints
CoreLoops
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
base2
exp3
Expected Output
8
Click RUN to test your solution