export const pow = (x, y) => {
let i = 2;
let num = 2;
if ((y === 0 && (x >= 1) )) {
return 1;
} else if (y === 1 && (x >= 1)) {
return x;
} else if (x === 1 && (y >=1)) {
return 1;
} else if (x === 0) {
return 0;
} else (y >= 2)
while (i <= y) {
num *= x;
i++;
} return num;
}
The above code works when I run it but it doesn't pass when I submit it. Could someone explain to me where I'm going wrong.