How to approach finding exponent characters in an array

So I’ve just written code which scans an array of string characters and checks for an exponent to the power of 2.

At the moment it’s hard coded to the Math.pow( index, 2). How could I refactor this or what techniques could I use to search through the whole array for an unknown power exponent?

My Code so far

function loop(array) {
    for(let i = 0; i < array.length; i++) {
        checkForExponent(array, i)

function checkForExponent(array, i) {
    if(array[i] === "*" && array[i + 1] === "*") {
            console.log("It's an exponent!");
            console.log(Math.pow(array[i-1], 2));

loop(["1","2","3","*", "*"]) // Should return 9

if this finds the two asterisks that indicate the exponentiation, you will know that the next thing should be the exponent. If your exponent is more than one digit it gets a bit harder but still doable

I misunderstood the exponential operator… Oh dear!. Primary school maths stuff