Catch Arguments Passed in the Wrong Order When Calling a Function

Catch Arguments Passed in the Wrong Order When Calling a Function
0.0 0

#1

Tell us what’s happening:
I can’t tell the difference in the order of argument; help!!!

Your code so far


let base = 3;
let exp = 2;


function raiseToPower(exp, base) {
  
  return Math.pow(exp, base);

}
let power = raiseToPower(exp, base);
  console.log(power);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function


#2

The issue you are having is that the second challenge requirement says “Your code should use the correct order of the arguments for the raiseToPower function call.”

Instead of switching the order of the base and exponent parameters in your function, try switching the order of them inside the power variable.