How To Write Power Function In Javascript