Find Exponentiation

Report a typo

Given an array of three elements, compute the exponentiation of the numbers from right to left. So, if the array is [x, y, z] , you must calculate (x ^ (y ^ z)). Use console.log in the function to output the reduced array.


Try reversing the order of the elements

Sample Input 1:

1 2 3

Sample Output 1:

1

Sample Input 2:

2 1 2

Sample Output 2:

2

Sample Input 3:

2 2 1

Sample Output 3:

4
Write a program in JavaScript
function calculateExp(numbers){
let result = ...
}
___

Create a free account to access the full topic