https://github.com/techeverri/pow
Iterative and recursive implementation of the exponentiation function using TypeScript
https://github.com/techeverri/pow
interview jest typescript
Last synced: 22 days ago
JSON representation
Iterative and recursive implementation of the exponentiation function using TypeScript
- Host: GitHub
- URL: https://github.com/techeverri/pow
- Owner: techeverri
- License: mit
- Created: 2020-10-14T21:58:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T16:33:46.000Z (3 months ago)
- Last Synced: 2025-02-11T12:22:34.149Z (2 months ago)
- Topics: interview, jest, typescript
- Language: TypeScript
- Homepage:
- Size: 564 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/techeverri/pow/actions/workflows/main.yml)
# Task
The task is to implement the `pow()` function (aka [exponentiation](https://en.wikipedia.org/wiki/Exponentiation))
## Requirements
- The `pow()` function should return `base` to the `exponent` power
- You are not allowed to use the built in [`Math.pow()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) or the [exponentiation operator (\*\*)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation).
- The `pow()` function should be properly documented using [JSDoc](https://jsdoc.app/) syntax
- Add a few unit tests for testing the `pow()` function## Testing
- Clone the project
- Install the dependencies `npm install`
- Run `npm test`