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
```