myPow = (x, n) => {
    const isBaseCase = (n === 0);
    if (isBaseCase) return 1;

    const abs = Math.abs(n);
    const isEven = ((abs % 2) === 0);

    const power = isEven
        ? myPow((x * x), (abs / 2))             /* Time O(log(N)) | Space O(log(N)) */
        : (myPow((x * x), ((abs - 1) / 2)) * x);/* Time O(log(N)) | Space O(log(N)) */

    const isNegative = (n < 0);

    return isNegative
        ? (1 / power)
        : power;
}
DFS
Time (log(N)) | Space O(log(N))
https://leetcode.com/problems/powx-n/
@param {number} x
@param {number} n
@return {number}