Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 21 days ago
JSON representation

Iterative and recursive implementation of the exponentiation function using TypeScript

Awesome Lists containing this project

README

        

[![Continuous Integration](https://github.com/techeverri/pow/actions/workflows/main.yml/badge.svg)](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`