Menu
I have an assigment to write a JavaScript program to define a recurcive function that calculates the result of two to power ‘n’ where n is any integer. I have to do this without using built in functions.I also have to concider that 2 to power n is 2*2 to power (n-1) recurcive. i have to use the fact that 2 to power 0 is 1 as my base case.
as the second part of the assignmet i hae to do the same for 8 and 16. I also have to the write a general function to find power of ‘m’ to power ‘n’ also without using any built in functions.
The function has to calculate this even if n is a negative number.