Menu
Coddy logo textTech

16. Calculate Power

Lesson 17 of 31 in Coddy's 30 Days of Logic Building in Javascript course.

challenge icon

Challenge

Easy

Write a function to calculate the power of a number.

  • Input: <strong>2</strong>, <strong>3</strong>
  • Output: <strong>8</strong>

Try it yourself

function power(base, exponent) {
    // write your code below 
    
}

All lessons in 30 Days of Logic Building in Javascript

Practice on your own: Online JavaScript compiler