simple-calculator-v1
v1.0.3
Published
A simple calculator module
Downloads
7
Maintainers
Readme
Calculator Project Documentation
Overview
This project is a simple calculator implemented in JavaScript, allowing users to perform basic arithmetic operations and generate a random ID.
Features
1. Addition
- Function:
add(a, b)
- Description: Adds two numbers (
a
andb
) and returns the result.
2. Subtraction
- Function:
sub(a, b)
- Description: Subtracts the second number (
b
) from the first number (a
) and returns the result.
3. Multiplication
- Function:
mul(a, b)
- Description: Multiplies two numbers (
a
andb
) and returns the result.
4. Division
- Function:
div(a, b)
- Description: Divides the first number (
a
) by the second number (b
) and returns the result.
5. Random ID Generation
- Function:
uid()
- Description: Generates a random alphanumeric ID.
Usage
Include the calculator module in your JavaScript project:
const { add, sub, mul, div, uid } = require('./simple-calculator');