Implement a function pow in helper.js that takes two numbers and
returns the first number raised to the power of second number. Examples:

pow(2, 2) // 4
pow(2, 0) // 1
pow(0, 2) // 0

You can’t use Math.pow
Make sure you’re handling well situations where one of x or y is very big and the other is very small, particularly 0 or 1.
You shouldn’t waste computational resources in this case.

This task is part of the Full-Stack JavaScript Course
If you have any issues with it, you can ask for community help below the post
Feel free to help others if you’ve already solved the task

helper.js

export const pow = (x, y) => {
  return 1;
}

solution.js

/**
 * Implement a function pow in helper.js that takes two numbers and
 * returns the first number raised to the power of second number
 *
 * pow(2, 2) // 4
 * pow(2, 0) // 1
 * pow(0, 2) // 0
 *
 * You can't use Math.pow
 * */

import { pow } from './helper.js';

const x = 2;
const y = 2;

console.log(`${x} raised to the power of ${y} is ${pow(x, y)}`); // 4